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

Home » Public Forums » archive » PLOT x and y ranges
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
PLOT x and y ranges [message #70206] Fri, 19 March 2010 06:46
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
More fun with "expected" unexpected behaviour,.. this time with PLOT.

If you give PLOT an XRANGE but not a YRANGE, it automatically
determines the y range by looking at the minimum and maximum data
point in the range xrange[0]:xrange[1]. Sounds reasonable.

But that's not necessarily the x range that gets plotted (unless
XSTYLE=1). For example, consider the difference between the following:

plot, [0,1,2,3,4], [2,1,2,1,43]
plot, [0,1,2,3,4], [2,1,2,1,43], xrange=[0,3.1]

In both cases, the plot goes from 0 to 4 in x, but the y ranges are
wildly different: 0-80 in the first case, and 0-2 in the second.

Of course, the fact that the line jumps almost vertically in the
second plot should tell you that something's up... but where this gets
really sneaky is if you use PSYM=10 (or equivalently, if this is
getting called inside PLOTHIST in the astronomy library). For example,
the following two plots look identical and would lead you to believe
that the last bin contains a 2:

plot, [0,1,2,3,4], [2,1,2,1,69], xrange=[0,3.1], psym=10
plot, [0,1,2,3,4], [2,1,2,1,2], xrange=[0,3.1], psym=10

-Jeremy.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: readf,1,format= ......
Next Topic: Re: PLOT x and y ranges

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

Current Time: Wed Oct 08 15:47:07 PDT 2025

Total time taken to generate the page: 0.00500 seconds