plot position keyword [message #89402] |
Tue, 07 October 2014 12:46 |
Mark Quigley
Messages: 8 Registered: August 2009
|
Junior Member |
|
|
I haven't found this in the documentation so I thought I'd post it here, my apologies is this is old news.
I have a routine that creates an array of position vectors, something like what is done with !p.multi=[0,2,2], with a few bells and whistles which don't matter here. For example:
pos = sub_multipos(2,3)
plot,findgen(10),pos = pos[*,NN] ;where NN is 0 to 5.
What I want to do to use the pos array if it exists, or the position defined by !p.multi if is doesn't.
It turns out that this works:
!p.multi=[0,2,2] at some point earlier....
pro something, arr,pos
;pos not defined
pos = n_elements(pos) eq 0 ? [!null,!null,!null,!null] : pos
plot,arr,pos=pos
arr is plotted where it should be according to !p.multi.
|
|
|