Graph axis in middle of wave-line

Dear Igor Users,

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
I don't understand what you are trying to do. By default, the left axis and the bottom axis do cross one another at 0. If you are trying to make a plot of a current vs. voltage relationship (for example, to display the I-V curve of a current), what I usually do is plot my wave on two free axes, instead of the default left and bottom axis.

So, for example,
Display /L=current /B=voltage myIVWave


Then, you want the two axes to cross one another at zero, so do
ModifyGraph freePos(current)={0,voltage},freePos(voltage)={0,current}
Thanks for your help AClight,

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
Ok, so I couldn't resist trying this..

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"?


Function plotIV()

Display /L=current /B=voltage JB133_005I

ModifyGraph freePos(current)={0,voltage},freePos(voltage)={0,current}

end



Olav Kiam wrote:
Dear Igor Users,

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


displayHelpTopic "Graphs[Types of axes]"
shows the method you want. e.g.

make/O AA=p/1000-0.05,VV=p/10-5;
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 VertCrossing,-80e-3,80e-3;
setAxis HorizCrossing,-8,8;


Regards,
Patrick.
patg wrote:


displayHelpTopic "Graphs[Types of axes]"
shows the method you want. e.g.

make/O AA=p/1000-0.05,VV=p/10-5;
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 VertCrossing,-80e-3,80e-3;
setAxis HorizCrossing,-8,8;


Regards,
Patrick.


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 a wave with data that approximates that of a real current.
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