Overplotting on several graphs [message #3104] |
Thu, 17 November 1994 04:31  |
ECSPRS
Messages: 6 Registered: November 1994
|
Junior Member |
|
|
I would like to plot data on say 5 graphs as I read it from a file with
overplotting. ie. the first five sets of data are plotted on separate graphs
(in the one window) and the next five sets of data are plotted on top of the
first five plots. The problem with oplot is that it only works with the last
plot command, so is there any way to go from graph 5 back up to graph 1 and do
an overplot? I'm anticipating reading a lot of data so I don't really want to
read the entire file and then plot at the end. Also five passes through the
file seems a rather inefficient way to go.
Thanks,
Paul
|
|
|
Re: Overplotting on several graphs [message #3175 is a reply to message #3104] |
Tue, 22 November 1994 11:30  |
pellet
Messages: 12 Registered: October 1994
|
Junior Member |
|
|
Paul Smith (ECSPRS@LURE.LATROBE.EDU.AU) wrote:
: I would like to plot data on say 5 graphs as I read it from a file with
: overplotting. ie. the first five sets of data are plotted on separate graphs
: (in the one window) and the next five sets of data are plotted on top of the
: first five plots. The problem with oplot is that it only works with the last
: plot command, so is there any way to go from graph 5 back up to graph 1 and do
I think you would have to save the !X and !Y sysvar after each one of these
graph is created and restore them to their proper values before doing
the oplot command. Take a look at the help or documentation about these
sysvar.
Good luck.
Jeff
|
|
|
Re: Overplotting on several graphs [message #3196 is a reply to message #3104] |
Fri, 18 November 1994 05:20  |
sterner
Messages: 106 Registered: February 1991
|
Senior Member |
|
|
ECSPRS@LURE.LATROBE.EDU.AU (Paul Smith) writes:
> I would like to plot data on say 5 graphs as I read it from a file with
> overplotting. ie. the first five sets of data are plotted on separate graphs
> (in the one window) and the next five sets of data are plotted on top of the
> first five plots. The problem with oplot is that it only works with the last
> plot command, so is there any way to go from graph 5 back up to graph 1 and do
> an overplot? I'm anticipating reading a lot of data so I don't really want to
> read the entire file and then plot at the end. Also five passes through the
> file seems a rather inefficient way to go.
> Thanks,
> Paul
To overplot an a plot done before the last one you need to restore
several system variables to the state they had just after that plot.
The system variables are !x, !y, and !p. Save them after a plot,
do your other plots, then restore them to do an overplot.
Here is a simple example:
!p.multi=[0,2,2]
plot,[0,10],titl='A' & xa=!x & ya=!y & pa=!p
plot,[0,10],titl='B' & xb=!x & yb=!y & pb=!p
plot,[0,10],titl='C' & xc=!x & yc=!y & pc=!p
plot,[0,10],titl='D' & xd=!x & yd=!y & pd=!p
!x=xa & !y=ya & !p=pa & oplot,[10,5]
!x=xc & !y=yc & !p=pc & oplot,[5,0]
You may want to make a procedure to save and restore the plot state by some
index number.
Ray Sterner sterner@tesla.jhuapl.edu
Johns Hopkins University North latitude 39.16 degrees.
Applied Physics Laboratory West longitude 76.90 degrees.
Laurel, MD 20723-6099
|
|
|