Skip to main content

3.9) Saving Plots


The simplest way to save your plots is to output it to a postscript file.

Firstly tell IDL that we want to plot a postscript file (ps) instead of to a window, using the "set_plot" command.

set_plot, 'ps'

Next we set the filename for our file and that we want a colour plot.

device, filename='myplot.ps', /color

Now run the code that produces the plot.

.r simple_plot

Now we need to close the postscript file.

device, /close

Finally, use set_plot again to switch the plotting back to the screen (for Unix/Linux we use 'x', for X-Windows).

set_plot, 'x'