labeling a mirror axis or insert a vertical text
mwpro
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!
I don't think so. I wanted to do this a few days ago and found this on IgorExchange http://www.igorexchange.com/node/1262#comment-1533
Not sure if that is still the case - I didn't pursue it.
April 24, 2018 at 11:40 am - Permalink
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.April 24, 2018 at 01:00 pm - Permalink
Thank you both!!
April 24, 2018 at 02:57 pm - Permalink
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 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
April 25, 2018 at 01:16 am - Permalink
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
April 25, 2018 at 10:42 am - Permalink
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.April 26, 2018 at 07:39 am - Permalink
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
April 26, 2018 at 08:12 am - Permalink
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.
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.//printed 37213.4
April 26, 2018 at 08:37 am - Permalink