Graph axis in middle of wave-line
Olav Kiam
Is it possible to put the x-axis and the y-axis on the zero line? This way the graph-line would be something like Current = a*Voltage, and the both axis' would look like a coordinate system, except with different scalings.
If this is possible, how can you do that?
Thanks in advance,
Olav
So, for example,
Then, you want the two axes to cross one another at zero, so do
October 25, 2008 at 09:06 am - Permalink
Off course the axis' cross at 0. I didn't explain well enough. I want the axis' to extend beyond 0 towards negative values, and still have the axis's cross at 0 (origin).
This way, the axis would form across, instead of the x-axis on the bottom (should be in the middle), and the y-axis on the left (should also be in the middle).
I hope this makes it more clear. Maybe what you posted all ready is the solution to my problem, but I can only tested it tomorrow morning (GMT +1).
Thanks a lot for your help!
Olav
October 25, 2008 at 10:55 am - Permalink
What I get when I use those two lines I get the the x-axis nicely in the middle, just as i would like it to be. The Y-axis however, is still on the left side. I assume this is because I am not plotting the current against voltage, but against the index.
See image to see exactly what I mean.
How should i change my code (below) so that Igor also sets the y-axis in the middle (which actually means that the x-value '0' is in the middle of the graph), given that the voltage wave is named: "JB133_005V"?
Display /L=current /B=voltage JB133_005I
ModifyGraph freePos(current)={0,voltage},freePos(voltage)={0,current}
end
October 25, 2008 at 11:32 am - Permalink
•displayHelpTopic "Graphs[Types of axes]"
shows the method you want. e.g.
•display
•AppendToGraph/L=VertCrossing/B=HorizCrossing AA vs VV
You can select these axes from the 'append traces to graph...' menu item
To make them symmetric, just use the SetAxis:
•setAxis HorizCrossing,-8,8;
Regards,
Patrick.
October 25, 2008 at 07:41 pm - Permalink
This was exactly what I was looking for!
Great, thanks!
October 26, 2008 at 04:34 am - Permalink
By the way, there's no need to plot an x wave vs. a y wave to get what you want (as Patrick shows above). You could just as easily plot a single wave which has its scale set correctly using the SetScale command. The key is using the SetAxis command, as Patrick pointed out, to set the range for each axis that is drawn/displayed. By the way, if your data wave had negative x values (this would only happen if you've set the scale using SetScale) then you likely would not need to use the SetAxis command, as Igor is usually smart enough to automatically set the range of the axes to display all of your data.
For example:
Make/O/N=(20) IVwave
SetScale/P x -0.07, 0.01, "V", IVWave // Set x scaling.
SetScale d -1000, 1000, "A", IVWave // Set data (y values) scaling.
IVWave = x / 1e9
IVWave[x2pnt(IVWave, 0), *] = (0.1 * x) / 1e9
Display/L=current /B=voltage IVWave
ModifyGraph freePos(current)={0,voltage},freePos(voltage)={0,current}
// Make sure units displayed in graph are mV.
ModifyGraph prescaleExp(voltage)=3
October 26, 2008 at 07:19 am - Permalink