X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 13 Jul 2011 03:02 PM by  anon
How do you associate data with a secondary Y axis?
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:10
New Member


--
13 Jul 2011 03:02 PM
    Hello, I understand how to use the AXIS function in IDL 8.1 to create a second X or Y axis on a plot, but how do you link the data so that it corresponds to the second axis? For example, if DATA1 has a range of 0 to 10, but DATA2 has a range from 1,000 to 30,000 and how can you add the second axis so that each dataset can be properly plotted on the same figure? I recall that in when using the AXIS procedure, you could use the /SAVE keyword to set the axis system variable, but I don't see a similar feature in the AXIS function. It also isn't clear how you establish the YRANGE using the AXIS function. Any assistance would be greatly appreciated. Thank you, Kim

    Deleted User



    New Member


    Posts:
    New Member


    --
    12 Aug 2011 04:17 PM
    Hi Kim, What about the following example code?, could this help?: pro axis_diff_data_ex f1=findgen(100) f2=sin(findgen(100)) data2=f2 nop=plot(data2, /nodata, axis_style=0) p2=plot(f2, axis_style=0, /current, color='red') p1=plot(f1, axis_style=1, /current) a=axis('Y', location=[f1[-1]+1,0], tickdir=0,textpos=1, target=nop) end Note that the statement for the second plot (p2) is called before the first plot (p1). Also, note the usage of the keyword "target" to the axis function. Cheers, Fernando
    You are not authorized to post a reply.