comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » second Y axis.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: second Y axis. [message #86995 is a reply to message #86983] Thu, 19 December 2013 06:18 Go to previous messageGo to previous message
limiqt is currently offline  limiqt
Messages: 27
Registered: October 2013
Junior Member
On Wednesday, December 18, 2013 7:07:14 PM UTC-5, David Fanning wrote:
> Lim writes:
>
>
>
>> I was wondering if someone has a suggestion to produce a second Y axis, using the coyote graphic libraries, similar to the figure at: http://www2.astro.psu.edu/xray/docs/TARA/ae_users_guide/img1 05.png
>
>>
>
>> The second Y axis looks like is floating in the graph.
>
>>
>
>> I will appreciate any suggestions.
>
>
>
> Ah, I see. Well, this is one place where object graphics probably has an
>
> advantage over direct graphics. I think you are going to have to do
>
> something like this. Here is modified code from what you can find on my
>
> web page:
>
>
>
> PRO Additional_Axes_Plot
>
>
>
> ; Create some data.
>
> data_1 = cgScaleVector(cgDemodata(17), 0.0, 1.0)
>
> data_2 = cgScaleVector(cgDemodata(17), 0.0, 1000.0)
>
> data_3 = (Findgen(101)+1) / 5
>
>
>
> thick = (!D.Name EQ 'PS') ? 4 : 2
>
>
>
> ; Open a window and draw the plot without either of the Y axes.
>
> cgDisplay, 600, 450
>
> cgPlot, data_1, YStyle=4, Position=[0.15, 0.15, 0.7, 0.820], /NoData
>
>
>
> ; Draw the first Y axis in red.
>
> cgAxis, YAxis=0.0, /Save, Color='red7', YTitle='Data 1'
>
> cgOPlot, data_1, Color='red7', Thick=thick
>
>
>
> ; Draw the second Y axis in green.
>
> cgAxis, YAxis=1.0, /Save, Color='grn7', YTitle='Data 2', $
>
> YRange=[0,1000]
>
> cgOPlot, data_2, Color='grn7', LineStyle=2, Thick=thick
>
>
>
> ; Draw the third Y axis in blue.
>
> thisWindow = !D.Window
>
> cgDisplay, !D.X_Size, !D.Y_Size, /Free
>
> cgPlot, data_1, YStyle=4, Position=[0.15, 0.15, 0.7, 0.650], /NoData
>
> WDelete, !D.Window
>
> WSet, thisWindow
>
>
>
> cgAxis, 0.85, 0.15, /Normal, YAxis=1.0, /Save, Color='blu7', $
>
> YTitle='Data 3', YRange=[0.1,100], /YLog
>
> cgOPlot, data_3, Color='blu7', LineStyle=1, Thick=thick
>
>
>
>
>
> END ;*********************************************************** ******
>
>
>
> Cheers,
>
>
>
> David
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")


Hi David, yes, your solution is very cool. thank you so much.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Ternary diagrams
Next Topic: 'Replicat' a string array

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:52:21 PDT 2025

Total time taken to generate the page: 0.07234 seconds