How to Save a PostScript File

Place this part of the code somewhere near the top of your program, at least before the "plot" or "contour" command.
 

Set_PLOT, 'PS'
DEVICE, FILENAME = 'plotgre.ps'
plotgre.ps is the name of the postscript file to be created--it must end in .ps

After you have made your plot, you can close the file.  It isn't necessary to use this unless you spawn to a printer or, as in this case, the output is redirected to the X Windows monitor after the postscript file is written (although this feature doesn't always work). Use 'WIN' for Microsoft Windows, and 'MAC' for Macintoshes.  For a complete listing see table 8-1 of the IDL Reference Guide.

DEVICE, /Close_File
Set_Plot, 'X'
An example where this is used in a program is plotber.pro


If you want to make an encapsulated postscript file, just add /Encapsulated as follows:

DEVICE, /Encapsulated

You should note, that encapsulated files will not print on a PostScript printer by themselves.  In fact, you also won't be able to view the encapsulated files in other documents unless you use /Preview:

DEVICE, /Encapsulated, /Preview