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

Home » Public Forums » archive » Re: /YNOZERO
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: /YNOZERO [message #42654] Sat, 19 February 2005 06:30 Go to next message
Chris Lee is currently offline  Chris Lee
Messages: 101
Registered: August 2003
Senior Member
In article <cv573u$mmc$1@news.nems.noaa.gov>, "Mr. No Address"
<no_given_address@landofthelost.net> wrote:


> I'm trying to create a plot with a fixed YRANGE for YAxis=0 and a self
> scaling range incorporating /YNOZERO for YAxis=1. Here is the code:
> PLOT, TIME, DATA.TEMP1, COLOR=0, /NODATA, YRANGE=[30,45], YSTYLE=8
> OPLOT, TIME, DATA.TEMP1, COLOR=1
> AXIS, YAxis=1, /YNOZERO, /Save
> OPLOT, TIME, DATA.TEMP2, COLOR=2
> The above code produces a YAxis=1 that is the same scale as YAxis=0. The
> only way I'm able to get YAxis=1 to a scale different than YAxis=0 is to
> explicitly set the range.
> Gary

What do you want Yaxis=1 to scale to? it doesn't know about the data, it
only knows what went into the environment variables, !y.crange and
!y.range. If you want a different scale yaxis=0, you will have to give it
a range.

what might do what you want is the following
;test data
x=findgen(100)*10.*!DTOR
a=sin(x)*10+100.
b=a-20.
position=[0.1,0.1,0.9,0.9]
black=fsc_color('black',255) & white = fsc_color('white',0) & red=fsc_color('red', 100)
plot, a, ystyle=8, yrange=[80,120], color=black, background=white,position=position
plot, b, /ynozero, xstyle=5, ystyle=5, color=red,/noerase, position=position
axis, 100., yax=1, color=red

;;;;
I imagine there are better ways though.

Chris.
Re: /YNOZERO [message #42706 is a reply to message #42654] Tue, 22 February 2005 08:40 Go to previous message
Mr. No Address is currently offline  Mr. No Address
Messages: 11
Registered: February 2005
Junior Member
Christopher Lee wrote:
> In article <cv573u$mmc$1@news.nems.noaa.gov>, "Mr. No Address"
> <no_given_address@landofthelost.net> wrote:
>
>
>
>> I'm trying to create a plot with a fixed YRANGE for YAxis=0 and a self
>> scaling range incorporating /YNOZERO for YAxis=1. Here is the code:
>> PLOT, TIME, DATA.TEMP1, COLOR=0, /NODATA, YRANGE=[30,45], YSTYLE=8
>> OPLOT, TIME, DATA.TEMP1, COLOR=1
>> AXIS, YAxis=1, /YNOZERO, /Save
>> OPLOT, TIME, DATA.TEMP2, COLOR=2
>> The above code produces a YAxis=1 that is the same scale as YAxis=0. The
>> only way I'm able to get YAxis=1 to a scale different than YAxis=0 is to
>> explicitly set the range.
>> Gary
>
>
> What do you want Yaxis=1 to scale to?

I'd like YAxis=1 to self scale using DATA.TEMP2 in the following OPLOT
line. I want the /YNOZERO option so that zero is not used for the min Y
value. I did think about doing something similar to your code below.
I'm using !P.MULTI = [0,2,2] though and each new instance of Plot
creates a plot in the next panel. Of course, there is probably a way to
prevent that... Maybe I'd have to use POSITION instead of !P.MULTI.

Gary

> it doesn't know about the data, it
> only knows what went into the environment variables, !y.crange and
> !y.range. If you want a different scale yaxis=0, you will have to give it
> a range.
>
> what might do what you want is the following
> ;test data
> x=findgen(100)*10.*!DTOR
> a=sin(x)*10+100.
> b=a-20.
> position=[0.1,0.1,0.9,0.9]
> black=fsc_color('black',255) & white = fsc_color('white',0) & red=fsc_color('red', 100)
> plot, a, ystyle=8, yrange=[80,120], color=black, background=white,position=position
> plot, b, /ynozero, xstyle=5, ystyle=5, color=red,/noerase, position=position
> axis, 100., yax=1, color=red
>
> ;;;;
> I imagine there are better ways though.
>
> Chris.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Histogram shift
Next Topic: Importing IDL plots to Powerpoint on Mac

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

Current Time: Fri Oct 10 19:22:33 PDT 2025

Total time taken to generate the page: 0.95893 seconds