Re: positioning oplots [message #444] |
Wed, 05 August 1992 04:35  |
zawodny
Messages: 121 Registered: August 1992
|
Senior Member |
|
|
You can cure the problem of all the plots endding up in the last plot
box by changing the first element of !p.multi. For instance if you have set
!p.multi = [0,2,3,0,0] previously and plotted six or fewer plots and now wish
to overplot something in the first plotbox, then set !p.multi(0) = 6 (or 5 for
the second plot box etc.) If the x(y).range vary from plot to plot you will
also have to reestablish the correct coordinate system (data to device mapping)
with a call to plot like
PLOT,[0],xrange=[xmin,xmax],yrange=[ymin,ymax],xstyle=5,ysty le=5,/nodata
This call should only reset x(y).crange and !p.clip (and a few related things)
without redrawing anything (you may also have to set the titles to the null
string).
Best of Luck
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- *-*-*-*-*-*-*-*-*-*
Joseph M. Zawodny (KO4LW) /\
NASA Langley Research Center \/ THIS SPACE
Hampton VA, 23665-5225 /\ FOR RENT
zawodny@arbd0.larc.nasa.gov \/
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- *-*-*-*-*-*-*-*-*-*
|
|
|
Re: positioning oplots [message #445 is a reply to message #444] |
Wed, 05 August 1992 07:18  |
thompson
Messages: 584 Registered: August 1991
|
Senior Member |
|
|
In article <BsIDJo.8LE@news.larc.nasa.gov>, zawodny@arbd0.larc.nasa.gov (Dr. Joseph M Zawodny) writes...
> You can cure the problem of all the plots endding up in the last plot
> box by changing the first element of !p.multi. For instance if you have set
> !p.multi = [0,2,3,0,0] previously and plotted six or fewer plots and now wish
> to overplot something in the first plotbox, then set !p.multi(0) = 6 (or 5 for
> the second plot box etc.) If the x(y).range vary from plot to plot you will
> also have to reestablish the correct coordinate system (data to device mapping)
> with a call to plot like
>
> PLOT,[0],xrange=[xmin,xmax],yrange=[ymin,ymax],xstyle=5,ysty le=5,/nodata
>
> This call should only reset x(y).crange and !p.clip (and a few related things)
> without redrawing anything (you may also have to set the titles to the null
> string).
Several people have suggested that one needs to reset the first parameter of
!P.MULTI. However, as far as I can tell, this only works for overplotting if
one uses a command such as above. Even if the X and Y ranges are the same for
each plot, unless a PLOT command like the above is used, then the OPLOTs do not
end up in the right place. This is because other system variables such as
!X.WINDOW and !X.S do not get reset until a plot is done.
Also, the above command should also include a /NOERASE switch in case
!P.MULTI(0) = 0.
I will point out that the X and Y ranges used in the above command can be
obtained from the system variables !X.CRANGE and !Y.CRANGE immediately after
the initial plots, i.e.
!P.MULTI = ... ;Start first plot
PLOT, ...
XRANGE1 = !X.CRANGE
YRANGE1 = !Y.CRANGE
and then
!P.MULTI = ...
PLOT,XRANGE=XRANGE1,YRANGE=YRANGE1, ...
OPLOT, ...
Bill Thompson
|
|
|
Re: positioning oplots [message #446 is a reply to message #444] |
Tue, 04 August 1992 15:10  |
thompson
Messages: 584 Registered: August 1991
|
Senior Member |
|
|
In article <1992Aug4.202655.25345@iscnvx.lmsc.lockheed.com>, kevin@dipl.rdd.lmsc.lockheed.com writes...
> jat@water.ca.gov (Jatinder Singh) writes ...
>
>> Does anyone know how to position 'oplots' ?
>>
>> I'm trying to analyze time-series data by plotting locations and
>> animating against time.
>>
>> My particular problem arises when I have more than one plot
>> per window (setting !p.multi to something other than 0).
>>
>> At the starting frame, I 'plot' the axes with '/nodata'. I
>> also save the axis endpoints from !x(y).window, in an array.
>>
>> In subsequent frames I 'oplot' the data, erase it after a delay,
>> and 'oplot' the next frame. I try to position the data into its
>> respective plot by using 'position' in the 'oplot' routine with
>> 'position' set to the saved axes for that plot. I use 'oplot' because
>> it's somewhat faster than 'plot', I only need to change the data, not the
>> axes, and it gets rid of the flickering associated with 'plot' in a loop.
>>
>> Result: all my plots for subsequent frames end up in the last
>> plot. 'position' seems to have no effect.
>
> I had a similiar problem doing a similiar aplication. Solution: don't use
> !p.position. Before each oplot, insert a !p.multi such that it is set so
> that the next plot will be in the location you want. Example:
>
> (assuming the axis' have already been drawn):
> !p.multi=[2,1,3,0,0]
> oplot,data
>
> The fragment above will do an overplot on the middle plot of a 3 plot window
>
> Kevin Anderson
>
I tried this, and it didn't seem to work. My own suggestion is to keep copies
of the !P, !X and !Y system variables for each plot, and then restore them
before doing any overplots, i.e.
!P.MULTI = ... ; Start plot #1
PLOT, ...
P1 = !P & X1 = !X & Y1 = !Y
etc.
and then
!P = P1 & !X = X1 & !Y = Y1
OPLOT, ...
Bill Thompson
|
|
|
Re: positioning oplots [message #447 is a reply to message #446] |
Tue, 04 August 1992 13:26  |
kevin
Messages: 17 Registered: August 1992
|
Junior Member |
|
|
jat@water.ca.gov (Jatinder Singh) writes ...
> Does anyone know how to position 'oplots' ?
>
> I'm trying to analyze time-series data by plotting locations and
> animating against time.
>
> My particular problem arises when I have more than one plot
> per window (setting !p.multi to something other than 0).
>
> At the starting frame, I 'plot' the axes with '/nodata'. I
> also save the axis endpoints from !x(y).window, in an array.
>
> In subsequent frames I 'oplot' the data, erase it after a delay,
> and 'oplot' the next frame. I try to position the data into its
> respective plot by using 'position' in the 'oplot' routine with
> 'position' set to the saved axes for that plot. I use 'oplot' because
> it's somewhat faster than 'plot', I only need to change the data, not the
> axes, and it gets rid of the flickering associated with 'plot' in a loop.
>
> Result: all my plots for subsequent frames end up in the last
> plot. 'position' seems to have no effect.
I had a similiar problem doing a similiar aplication. Solution: don't use
!p.position. Before each oplot, insert a !p.multi such that it is set so
that the next plot will be in the location you want. Example:
(assuming the axis' have already been drawn):
!p.multi=[2,1,3,0,0]
oplot,data
The fragment above will do an overplot on the middle plot of a 3 plot window
Kevin Anderson
|
|
|