Paolo Grigis wrote:
>
>
> Mr. No Address wrote:
>
>> 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.
>
> Use the crystall ball object (part of the esoteric library):
>
> future_argument=crystal_ball->do_prophecy(/get_future_argument,/extrapolate)
>
>
> (use of the keyword /guess instead of /extrapolate is faster, but
> less accurate)
>
> ;-)
Every time I post here, infrequently that it is, I always feel, make
that know, I am opening myself up to clever responses. If you have a
moment, read my response to Fanning that explains why it seems (to me)
IDL should be able to see the future. It also has my solution that I
think I'm going to stick with.
Your solution is noted though. Thanks for taking the time to respond.
Cheers,
Gary
> ------------------------------------------------------------ --
>
> On a more serious tone, what about doing a supplementary plot
> beforehand and storing the !y.crange somewhere, and reusing that
> as input yrange to the axis procedure? Or, if you don't have
> the data before doing the first plot, save !P.multi, switch to
> device NULL, plot DATA.TEMP2, save !y.crange, switch to your former
> plot device, restore !P.multi and call AXIS with yrange equal the
> saved !y.crange. Maybe not 100% straightforward... but it should work.
>
>
>
> x=[1,2,3]
> y=[2,3,5]
> ;we don't know the third array yet...
>
> !p.multi=[0,2,2]
>
> plot,x
>
> ;now we get the new data
> z=[10,8.6,10]
>
> pmulti=!p.multi
>
> set_plot,'NULL'
> plot,z,/ynozero
> yrange=!y.crange
>
> set_plot,'X'
> !p.multi=pmulti
> plot,y,ystyle=8
>
> AXIS, YAxis=1, /YNOZERO, /Save,yrange=yrange
>
> oplot,z
>
>
>
> Ciao,
> Paolo
>
>
>> 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.
>>
|