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.
|