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

Home » Public Forums » archive » How to clear a NG window without erase method?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
How to clear a NG window without erase method? [message #85436] Tue, 06 August 2013 11:03 Go to next message
Paul Van Delst[1] is currently offline  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 Go to previous message
chris_torrence@NOSPAM is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Automatic interpolation / smoothing in TV??
Next Topic: Questions about NG image with (log) axis

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

Current Time: Wed Oct 08 11:40:54 PDT 2025

Total time taken to generate the page: 0.00568 seconds