X
5241 Rate this article:
No rating

(New) Graphics Erase method

Anonym
Here's a small, but worthy, addition to IDL in 8.2: NG now has an Erase method, analogous to the ERASE procedure in DG. For example, a window with a plot and an annotation:
IDL> w = window(window_title='Reuse this window!')
IDL> p0 = plot(/test, /current)
IDL> l0 = legend()
can be erased by a call to the Erase method:
IDL> w.erase 
which completely erases any NG objects (including dataspaces and annotations) in the window. The window can then be reused for another graphic:
IDL> p1 = image(/test, /current)
Note the use of the CURRENT keyword to direct each visualization to the current NG window.