Re: plots? [message #31794 is a reply to message #31789] |
Tue, 20 August 2002 06:26   |
bin_zheng_99
Messages: 6 Registered: July 2002
|
Junior Member |
|
|
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!
|
|
|