(New) Graphics Erase method

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.

About these ads

About Mark

I solve scientific programming and visualization problems with IDL.
This entry was posted in language, visualization and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s