Re: Data range for axis has zero length [message #30693] |
Thu, 09 May 2002 12:37 |
Ted Cary
Messages: 53 Registered: October 2001
|
Member |
|
|
Derko Drukker wrote:
> if given from the IDL-prompt interactively: plot,[-1,4],[0,0] results
> in a plotwindow with xaxis from -1 to 4 and yaxis from 0 to 1
>
> Q1: where does this 1 in the yaxis come from ?
IDL has its own ideas about what graphs should look like and often
changes axis ranges to produce more aesthetically pleasing output.
Usually you can fix this using the XSTYLE and YSTYLE keywords to PLOT or
by setting the analogous style field in the !X and !Y system variables.
In your case, however, I'm not sure what you want an XY plot of a
horizontal line to look like... Do you completely want to remove the
y-axis, and plot your line against a 1-D number line? This is possible
if you play with the YSTYLE. You can also use PLOTS if you just want to
plot a line to the screen.
>
> Q2: why does it work interactively and not in batch ?
>
Are you sure this is the exact same line of code in the .pro file? I put
your PLOT command into a procedure and the same graph was produced,
although I know I've seen this error message before.
TC
|
|
|