How to "reuse" a function graphics plot window? [message #77400] |
Thu, 25 August 2011 10:01 |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
Hello,
This is probably a silly question with a (hopefully) simple answer, but here goes any way...
How does one reuse an already created FG plot window?
A common usage of mine when plotting in DG is to allow myself to sequentially view multiple plots in the same window
where I control the speed of update via use of get_kbrd(1), eg
for i = 0, np-1 do begin
plot, x, y[*,i]
q = get_kbrd(1)
if ( strupcase(q) eq 'Q' ) then break
endfor
Here the same plot window is "re-used" for all the subsequent plots. What I came up with via FG is
for i = 0, np-1 do begin
p = plot(x, y[*,i],/current)
q = get_kbrd(1)
if ( strupcase(q) eq 'Q' ) then break
if ( i lt np-1 ) then p.delete
endfor
which doesn't work right since the "p.delete" doesn't delete the axes.
The close method is no good since it destroys and creates another window (in another position .... and it steals my
mouse focus each time too).
Anyone have any ideas? Is there a technique or method that will allow me to do in FG what I have always been able to do
in DG?
thanks,
paulv
p.s. a working procedure exhibiting the above examples is below:
-----%<-----
pro blah
nx = 1000
np = 4
x = findgen(nx)/100.0
y = fltarr(nx,np)
y[*,0] = x^2
y[*,1] = 0.05*x^3
y[*,2] = 0.0025*x^4
y[*,3] = 0.0000125*x^5
for i = 0, np-1 do begin
plot, x, y[*,i]
q = get_kbrd(1)
if ( strupcase(q) eq 'Q' ) then break
endfor
for i = 0, np-1 do begin
p = plot(x, y[*,i],/current)
q = get_kbrd(1)
if ( strupcase(q) eq 'Q' ) then break
if ( i lt np-1 ) then p.delete
endfor
end
-----%<-----
|
|
|