comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: How to make this work? Oplot question.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: How to make this work? Oplot question. [message #4845] Thu, 03 August 1995 00:00 Go to previous message
korpela is currently offline  korpela
Messages: 59
Registered: September 1993
Member
In article <1995Aug2.161654.29779@news.wrc.xerox.com>,
Surendar Jeyadev <jeyadev@kaveri> wrote:
> I would greatly appreciate if someone can give me a hint on how to
> accomplish the following task in PV Wave.

I wrote a little routine to do what you want. (I use IDL, so it may not
be perfect in PV Wave, but it should work) As long as you use less than 10
windows, it should work without modification.
>
> x = findgen(100)/10.0
> y = exp(-0.1*x)*sin(4*x)
> plot, x, y ; plot decaying sin in !d.window=0
savestate
>
> wset, 1
> y = exp(0.1*x)*cos(4*x)
> plot, x, y ; plot rising cos in !d.window=1
savestate
>
> wset, 0
restorestate
> oplot, x, 0.1*x ; plot straight line in !d.window=0
>
> end

Here are the routines
------------------------------------------------------------ -----------------

pro savestate
common savestates,pstate,xstate,ystate,zstate,setpstate
if not(keyword_set(setpstate)) then begin
pstate=replicate(!p,10)
xstate=replicate(!x,10)
ystate=replicate(!y,10)
zstate=replicate(!z,10)
setpstate=1
endif
n=!d.window
pstate(n)=!p
xstate(n)=!x
ystate(n)=!y
zstate(n)=!z
end

------------------------------------------------------------ ------------------

pro restorestate
common savestates,pstate,xstate,ystate,zstate,setpstate
if not(keyword_set(setpstate)) then begin
pstate=replicate(!p,10)
xstate=replicate(!x,10)
ystate=replicate(!y,10)
zstate=replicate(!z,10)
setpstate=1
endif
n=!d.window
!p=pstate(n)
!x=xstate(n)
!y=ystate(n)
!z=zstate(n)
end

------------------------------------------------------------ ------------------
--
Eric Korpela | An object at rest can never be
korpela@ssl.berkeley.edu | stopped.
<a href=" http://www.cs.indiana.edu/finger/mofo.ssl.berkeley.edu/korpe la/w">Click here for more info.</a>
[Message index]
 
Read Message
Read Message
Previous Topic: How to make this work? Oplot question.
Next Topic: Re: WIDGET_OLH (online help) Help!

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:31:55 PDT 2025

Total time taken to generate the page: 0.00589 seconds