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 #86983 is a reply to message #86941] Wed, 18 December 2013 16:07 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
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.")
[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:32:16 PDT 2025

Total time taken to generate the page: 0.00545 seconds