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

Home » Public Forums » archive » Re: plots?
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: plots? [message #31789 is a reply to message #31778] Tue, 20 August 2002 07:31 Go to previous messageGo to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
helen wrote:

> David Fanning <david@dfanning.com> wrote in message
> news:<MPG.17cb6d6733fc1915989969@news.frii.com>...
>> helen (bin_zheng_99@yahoo.com) writes:
>>
>>> I have a problem about using plots. I want to use two plots for two
>>> different data sets at the same time. If I just use one plots for one
>>> data set, there is no problem. But when I use two, it doesn't work. It
>>> seems the two plots interrupt each other. I want to know why?
>>
>> I really can't tell what you are trying to do, but if you
>> put a couple of plots into your code so you have a good
>> reference point, it appears you are at least plotting
>> into both windows. I've never seen the CONTINUE keyword
>> before, and can't really tell what it does (or is suppose
>> to do) in this program.
>>
>> pro testPlots
>> arrayT = fltarr(11)
>> arrayX = fltarr(11)
>> arrayY = fltarr(11)
>> window, 1
>> plot,[0,10],[-10,10], /NoData
>> x1 = !X & y1 = !Y & p1 = !P
>> window,2
>> plot,[0,10],[-5,5], /NoData
>> x2 = !X & y2 = !Y & p2 = !P
>> for I=0, 10 Do begin
>> arrayY[I] = cos(I+1)
>> arrayX[I] = sin(I+1)
>> arrayT[I] = I
>> wset, 1
>> !X = x1 & !Y = x1 & !P = p1
>> plots,arrayT[I], arrayX[I], /continue
>> wset, 2
>> !X = x2 & !Y = y2 & !P = p2
>> plots,arrayT[I], arrayY[I], /continue
>>
>> endfor
>> end
>>
>> Does this give you any clues!?
>>
>> Are you trying to do this?
>>
>> arrayT = fltarr(11)
>> arrayX = Sin(fltarr(11) + 1)
>> arrayY = Cos(fltarr(11) + 1)
>> Window,3, arrayT, arrayX
>> Window, 4, arrayT, arrayY
>>
>> Cheers,
>>
>> David
>
> Hello, David,
>
> Thanks David for your help. But I still have not solved my problem. My
> problem is whether I can plot two different data in two windows at the
> same time? Because I want to track a target's movement and display its
> x (arrayX) and y (arrayY) position against the time (arrayT) at the
> real time. So that I can see the moving from the plots in these two
> windows. So, I write a simple program to test if I can plot two
> different data (arrayX against arrayT, arrayX against arrayT) at the
> same time and still get correct result? Is there a way to do this?
>
> Thanks very much for any suggestion!

Dear Helen,

this a normal common problem and may be I can help.
idl saves always only the last state of coordination vars of a window
to several system variables. So there is a transformation matrix neccesary
for each window you create depending on sizes, type and range. The routines
savesysvar and restsysvar are doing this for you.

After "plot" in first window or in your example creation of the window you
have to store the system vars by p1=savesysvar() and for the second window
plot into p2.
If you now actualize first window you have to restore their belonging
system variables by restsysvar,p1 and if you switch to plot on the other
window you have to set restsysvar,p2

http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/restsysvar.tar.gz
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/savesysvar.tar.gz

or as idl 5.5 binary
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/download/restsysvar.sav
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_source/idl_ html/dbase/download/savesysvar.sav

(Remember a idl compiled file with the extension sav is automaticly loaded
the first time it is used. This is the same behaviour as for idl sources
(.pro). They run on each idl platform with the same idl version)


For further routines and licensing please have a look at
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html



best regards

Reimar

pro test
arrayT = fltarr(11)
arrayX = fltarr(11)
arrayY = fltarr(11)
window, 1
;x1 = !X & y1 = !Y & p1 = !P
p1=savesysvar()
window,2
;x2 = !X & y2 = !Y & p2 = !P
p2=savesysvar()
for i=0, 10 Do begin
arrayY[i] = cos(i+1)
arrayX[i] = sin(i+1)
arrayT[i] = i
wset, 1
restsysvar,p1
; !X = x1 & !Y = x1 & !P = p1
plots,arrayT[i], arrayX[i], /continue
wset, 2
restsysvar,p2
; !X = x2 & !Y = y2 & !P = p2
plots,arrayT[i], arrayY[i], /continue

endfor

end


--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Weighting Function
Next Topic: Re: Frame-rate of IDL's MPEG movies ?

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

Current Time: Sun Oct 12 09:47:57 PDT 2025

Total time taken to generate the page: 0.23767 seconds