How to clear a NG window without erase method? [message #85436] |
Tue, 06 August 2013 11:03  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
Hello,
This is probably a silly question, but how does one clear a New Graphics
window without using the erase method?
Actually, let me put it another way by stating what I want to do:
1) Produce multiple plots, but all in the same window, separated by a pause.
2) Save each plot reference in a hash that is returned to the caller.
For example, consider the test code below. I want to return all the plot
references in the "gref" hash post-all-the-plotting:
-----%<-----
pro testplotcopy, gref = gref
; Pretend data
x = dindgen(100)
y = x^2
; Create a test window
owin = window(window_title='test window')
; Create an empty hash to hold the plot objects
gref = hash()
; Let's do 10 plots
for i = 1, 10 do begin
; Let's display all the plots in the same window
owin.Erase
; Plot stuff
gref[i] = plot(x,y,current=owin)
; Pause to view and reflect, then continue
q = GET_KBRD(1)
endfor
end
-----%<-----
The problem with this is the use of the "erase" method - that deletes
all the current graphics objects in the window.
Without the erase everything just gets plotted on top of everything else.
So, how does one clear a graphics window for subsequent plots, without
deleting all the previous plot references?
I'm having a brainfade on this, so thanks for any info/pointers/tips.
cheers,
paulv
|
|
|
Re: How to clear a NG window without erase method? [message #85545 is a reply to message #85436] |
Thu, 15 August 2013 10:42  |
chris_torrence@NOSPAM
Messages: 528 Registered: March 2007
|
Senior Member |
|
|
Hi Paul,
Did you ever get this working? I'm a little confused as to what you are trying to do. Do you want the plot lines to all remain, but get hidden?
If so, you could just do:
for i = 1, 10 do begin
; Plot stuff
gref[i] = plot(x,y, /overplot)
; Pause to view and reflect, then continue
q = GET_KBRD(1)
; Hide the plot line but not the axes
gref[i].hide = 1
endfor
Does this help?
-Chris
ExelisVIS
|
|
|