PLOT keywords vs System Variables [message #986] |
Fri, 16 April 1993 06:41 |
hadfield_m
Messages: 3 Registered: April 1993
|
Junior Member |
|
|
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
and get:
<Expression> FLOAT = Array(4)
0.000000 0.000000 0.000000 0.000000
Now, as I understand it, the !P, !X and !Y system variables provide
defaults which can be overridden in a call to a graphics routine by a
keyword. If aaaa is a valid keyword for PLOT, and if there is a
corresponding field !P.aaaa, then
plot ,X , Y, aaaa=!P.aaaa
should give the same result as calling plot without the keyword. Similarly
plot ,X ,Y ,Xbbbb=!X.bbbb ,Ycccc=!Y.cccc
But it doesn't work that way for position.
Can anyone with a deeper understanding than mine of the IDL language
explain why?
PS: If anyone really wants to know WHY I am trying to call PLOT with keywords
that don't alter its default behaviour I'll explain.
------------------------------------------------------------ ------
| Mark Hadfield hadfield@wao.greta.cri.nz |
| NIWA Oceanographic (Taihoro Nukurangi) |
| 310 Evans Bay Rd, Greta Point Telephone: (+64-4) 386-1189 |
| PO Box 14-901, Kilbirnie Fax: (+64-4) 386-2153 |
| Wellington, New Zealand |
------------------------------------------------------------ ------
|
|
|