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

Home » Public Forums » archive » Re: Problem with multi plot
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Problem with multi plot [message #61936] Thu, 14 August 2008 00:09
Gaurav is currently offline  Gaurav
Messages: 50
Registered: January 2007
Member
Dear Dr. Fanning,
Thank you very much. The SAVE keyword saved the day for me.

That solves my problems (a) and (b) completely. In order to solve (c),
I just had to adjust the values to YMARGIN keyword in PLOT.

Regards
Gaurav
Re: Problem with multi plot [message #61943 is a reply to message #61936] Wed, 13 August 2008 06:07 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Gaurav writes:

> I am trying to display the following data on a single plot.
>
> xdata_area = [10, 20, 30, 40, 50]
> xdata_vol = [112, 224, 336, 448, 560]
> ydata = [20, 40, 60, 80, 100]
>
> Note that the y-values for both are the same. I would like to have a
> graph with two x-axes, with different ranges and the plots in two
> different colors. Following is the code I wrote-it can be copy pasted
> and run. I shall point out my troubles after that:

You need to add a SAVE keyword to your AXIS command,
then just OPLOT your second data set.

Typically, if you want just the data in different colors,
you draw the PLOT command with the NODATA keyword set,
then OPLOT your data in whatever color you like.

data = Randomu(-3L, 11) * 10
Plot, data, /NODATA, YSTYLE=9, BACKGROUND=FSC_Color('ivory'), $
COLOR=FSC_Color('navy')
Oplot, data, Color=FSC_Color('dodger blue')
AXIS, YAXIS=1, YRANGE=[0,100], /SAVE, COLOR=FSC_Color('navy')
Oplot, Reverse(data * 7.5), Color=FSC_Color('crimson')

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: subset a 2d array
Next Topic: how to preserve trailing Shallow dimensions!

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

Current Time: Wed Oct 08 15:39:52 PDT 2025

Total time taken to generate the page: 0.00645 seconds