labeling a mirror axis or insert a vertical text

Can I label a mirror axis?
I have more words than the space of one axis that can hold and I want to put the text onto the other side of the graph, can the mirror axis be labeled as well?
or I can use the drawing tool when a text box can be inserted, but I couldn't find out how the text can be rotated 90 degrees since the space along the axis is limited.
Could I get some help?

Thanks thanks!
mwpro wrote:
but I couldn't find out how the text can be rotated 90 degrees since the space along the axis is limited

The Modify Graph option on the Graph menu allows you to alter the size of the margins, as do commands like ModifyGraph margin=72. Then you could drag and rotate the label text from a real axis or use the drawing options to make text rotated as desired.
I see. I indeed can rotate then. The mirror is more tricky to deal with. Live with the inserted text now.

Thank you both!!
mwpro wrote:
Can I label a mirror axis?
I have more words than the space of one axis that can hold and I want to put the text onto the other side of the graph, can the mirror axis be labeled as well?
or I can use the drawing tool when a text box can be inserted, but I couldn't find out how the text can be rotated 90 degrees since the space along the axis is limited.
Could I get some help?

Thanks thanks!


Maybe you create the same trace twice for the {left,bottom} and {right,bottom|top} with the same data and label accordingly?

make/o/n=10 a = enoise(1)
make/o/n=10 b = enoise(4)
display a vs b
AppendToGraph/R a vs b
Label left "A long axis label on the left hand side"
Label bottom "bottom / au"
Label right "Units vert axis / au"
ModifyGraph width={Aspect,1},height={Aspect,1},tick(right)=3,mirror(bottom)=2,nticks(right)=0


best,
_sk
You can rotate drawing text- there is an editable combobox right above the text entry area that allows you to specify a rotation.

Another option would be to use a textbox annotation (Graph menu->Add Annotation). If you're not familiar with how they work, you may wish to read the help:
DisplayHelpTopic "Annotations"

You might want to consider an exterior annotation- for the right mirror axis, you would need to use the "Right Center" anchor position. See the attached picture for an example.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Graph0_12.png
I agree with _sk's solution, in that appending the same wave on the opposite axis (i.e.> appendtograph/R samewave) offers the most convenience and flexibility for right-side labeling. The downside potential is that the graph update time will increase.

If you have very large waves, or update them frequently that might be a problem. Fortunately, that problem can be alleviated by appending a sparse subset of the wave(s) as in appendtograph/R samewave[0,*;100], with the spacing increment chosen appropriately.

In the most general case, if the sparser trace has different minimum/maximum values, you may have to scale the new axis either manually or in a function as in GetAxis/Q/W=Graph1 Left; SetAxis/W=Graph1 right, V_min, V_max to make it identical to the original. I also recommend using a dot display with zero thickness so the sparser (duplicate) trace is not visible.
You know about multi-line labels?
make test=sin(x)/x
display test
Label left "You know about multi line\rlables, right?\nUse \\\\r or \\\\n"


Besides... What kind of labels are you using requiring text on both sides of a graph? I'm just curious...
I prefer short labels and a unit, if applicable. Explanations should go in a figure caption (or an additional text box) (in my opinion).

Addition: If update speed is an issue with the dummy trace, just use a 2 row dummy wave with the minimum and maximum values obtained from the real data wave.

HJ
A way to optimize both graph update speed and ease of use is to replot the wave on the second axis that will act as a mirror using ModifyGraph hideTrace(mirrorAxisTraceName)=2. (One can also select the duplicate trace trace in the Modify Trace Appearance dialogue and check hide trace, which then brings up another check box, "Include in autoscale", which in this case also gets checked.)

Compared to HJ's proposal of making a two point wave with the min and max of the main wave, this approach does not require tracking those values and updating the two point wave. However, HJ's approach appears to give faster updating (see below), so that might be preferred in some cases.

make/o/n=1e7 testa,testb; make/o/n=2 testc
testa=p;testb=p;testc[0]=0;testc[1]=dimsize(testa,0)-1
display/k=1/n=nohide testa; appendtograph/r testb
display/k=1/n=hide testa; appendtograph/r testb
ModifyGraph/w=hide hideTrace(testb)=2
display/k=1/n=minMax testa; appendtograph/r testc
ModifyGraph/w=minMax hideTrace(testc)=2
variable msTimer
msTimer=startMsTimer;modifygraph/w=nohide height=72*5,width=72*5;doupdate;print stopmstimer(msTimer)
//printed 734977
msTimer=startMsTimer;modifygraph/w=hide height=72*5,width=72*5;doupdate;print stopmstimer(msTimer)
//printed  514448
msTimer=startMsTimer;modifygraph/w=minMax height=72*5,width=72*5;doupdate;print stopmstimer(msTimer)
//printed  391949


Edit: I was curious whether all the additional overhead in updating the minMax graph in the above test was merely in calculating the min and max of the mirror axis wave. That seems to account for about a third of the difference (see below). So handling the min/max calculation and updating a 2-point wave looks like it would indeed be faster (at least in Igor 7.08 64 bit).

If one doesn't need the axis scalings to match, and just wants to label the axis, a one point wave of any value with ModifyGraph noLabel(right)=1 would probably be best.

•msTimer=startMsTimer;wmin=wavemin(testa);wmax=wavemax(testa);print stopmstimer(msTimer)
 //printed 37213.4