Re: How to make this work? Oplot question. [message #4850 is a reply to message #4845] |
Wed, 02 August 1995 00:00  |
rmmoss
Messages: 12 Registered: August 1995
|
Junior Member |
|
|
In article <1995Aug2.161654.29779@news.wrc.xerox.com>, jeyadev@kaveri (Surendar Jeyadev) writes:
|> I would greatly appreciate if someone can give me a hint on how to
|> accomplish the following task in PV Wave.
|>
|>
|> x = findgen(100)/10.0 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
|>
|> 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
Yep, saving the plotting system variables is exactly what you do. Its not that
bad, however. The following simple-minded way will suffice.
x = findgen(100)/10.0
y = exp(-0.1*x)*sin(4*x)
plot, x, y
;save the settings
pstate0 = !P
xstate0 = !X
ystate0 = !Y
zstate0 = !Z
wset, 1
y = exp( 0.1*x)*cos(4*x)
plot, x, y
;save new settings
pstate1 = !P
xstate1 = !X
ystate1 = !Y
zstate1 = !Z
;now proceed to overplot at will :)
wset, 0
;restore old settings
!P = pstate0
!X = xstate0
!Y = ystate0
!Z = zstate0
oplot, x, 0.1*X
etc, etc. As usual, there are more complicated ways of doing this, but you
get the idea ;)
Robert M. Moss, Ph.D.
Texaco Inc.
rmmoss@texaco.com
This is not necessarily the opinion of Texaco Inc.
|
|
|