Name:Why do my plots disappear?
Category:IDL
Author:Conor
Tip:

A common problem for people just getting started with IDL is that their plots disappear.  Usually this problem occurs frequently - everytime you plot something in an IDL window, and then another window is moved on top of the IDL window, the plot doesn't return when the interfering window is removed.  This can be easily fixed with the "retain" keyword to the window command.  Before issuing any plot commands, do this:

window,0,retain=2

The retain=2 keyword specifies that IDL should remember the contents of a window and reload them when the window returns to the screen.  You can also try retain=1, which attempts to force the windowing system itself to store the window contents (this doesn't always work though).

On a largely unrelated note, the number you pass to window ("0", in this case) simply tells IDL which window to load.  The only difference between the different plot windows is where they open on your screen by default.