How to make this work? Oplot question. [message #4851] |
Wed, 02 August 1995 00:00 |
jeyadev
Messages: 78 Registered: February 1995
|
Member |
|
|
I would greatly appreciate if someone can give me a hint on how to
accomplish the following task in PV Wave.
1) I have two plotting windows and procedures that (over)plot data
in each window. I want to keep overplotting in the first window
but not in the second one (but I think that this does not
matter) by calling procedures that set the current window
as required and then draw the (over)plot.
2) On the first round one of these procedures plots in !d.window=0
and then plots in !.window =1, which I get to by using
"wset, 1". The procedure then resets the current window by using
"wset, 0".
3) On the second round I call a procedure that needs to overplot
data in the first window ("0") and plot in the second window
("1").
In step 3 I find that while data is correctly plotted in the *second*
window, the overplot portion of the procedure is not drawn in the
first window. I realized that the reason that this was happening is
that the oplot part in the second round (to overplot data in window
"0" was using the scaling information resulting from the "plot"
call in the first round for plotting in window *"1"*.
I have a simple *main program* that exhibits this feature:
x = findgen(100)/10.0
y = exp(-0.1*x)*sin(4*x)
plot, x, y ; plot decaying sin in !d.window=0
wset, 1
y = exp(0.1*x)*cos(4*x)
plot, x, y ; plot rising cos in !d.window=1
wset, 0
oplot, x, 0.1*x ; plot straight line in !d.window=0
end
Before I run the program, I create window "1" and then issue "wset, 0".
I find the the decaying sin and the rising cos are correctly plotted
in, respectively, windows "0" and "1", but that the straight line in not
correctly overplotted in window "0" because the scaling used is that
for the rising cos rather than the existing decaying sin plot.
So, the question is, can I accomplish what I would like to do in a
simple way. Or do I have to store the scaling information for window "0"
and set that each time I return to it? Unfortunately, the scale factors
are vastly different for the two windows.
Thanks
--
Surendar Jeyadev jeyadev@wrc.xerox.com
|
|
|