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