Re: PLOT keywords vs System Variables [message #978] |
Mon, 19 April 1993 05:45 |
zawodny
Messages: 121 Registered: August 1992
|
Senior Member |
|
|
In article <1qmd1hINNc6o@golem.wcc.govt.nz> hadfield_m@kosmos.wcc.govt.nz writes:
>
> Consider the following
>
> plot,indgen(10)
>
> As you'd expect, a graph of a straight line appears on the graphics output
> device. But this:
>
> plot,indgen(10),position=!P.position
>
> gives a blank screen and the message:
>
> % PLOT: Data coordinate system not established.
> % Execution halted at $MAIN$ (PLOT).
>
> Just to make sure there's nothing strange about the setting of !P.position
> system variable we type:
>
> help,!P.position & print,!P.position
> <Expression> FLOAT = Array(4)
> 0.000000 0.000000 0.000000 0.000000
>
But this is strange! You have asked PLOT to draw a plot with dimensions of
zero. PLOT has to do some division by zero to set up the coordinate system. My
understanding is that if plot goes off and finds a !p(x or y).aaaa system
variable and finds it filled with zeros or null stings then it will use some
default value. When you specify a keyword though, IDL says "Hey, this guy must
know what he is doing" and uses it directly (no checking whether to use
defaults).
I do agree though that the behavior you would like to see should be the way
that it works. It would make a lot of programs easier to write. But for now
that is the way it is.
--
Joseph M. Zawodny (KO4LW) NASA Langley Research Center
Internet: zawodny@arbd0.larc.nasa.gov MS-475, Hampton VA, 23681-0001
Packet: ko4lw@wb0tax.va.usa
|
|
|