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

Home » Public Forums » archive » /YNOZERO
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: /YNOZERO [message #42704 is a reply to message #42672] Tue, 22 February 2005 09:32 Go to previous messageGo to previous message
Paolo Grigis is currently offline  Paolo Grigis
Messages: 171
Registered: December 2003
Senior Member
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)

;-)

------------------------------------------------------------ --

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.
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: file_basename(): bug or feature?
Next Topic: detection of events from the serial port

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

Current Time: Thu Oct 09 03:31:14 PDT 2025

Total time taken to generate the page: 0.16020 seconds