How to Print

There are several ways to print the graphs you create.


Here's how to Set_Plot:
Set_Plot, 'PRINTER'
This will send your output to the system printer.  Be sure and do this before you issue the plot command. Then, after you have plotted, you must enter the close document command:
DEVICE, /Close_Document


Spawning:
When you save a graph in a PostScript file, you must issue a Spawn command to also get it to print automatically.

Here's the simple way to spawn to the printer:

Set_Plot, 'PS'
DEVICE, FILENAME = 'ABPlot.ps'

Plot, A, B

DEVICE, /Close_File
Spawn, 'lpr ABPlot.ps'

Notes that you must close the postscript file before spawning.   You don't have to close the file if you don't spawn, but your postscript file won't be anything but null until you exit IDL.  Having the Close_File in there is a generally good idea.

Here's the fancy way to spawn to the printer:

PRO output_plot, New_file

DEVICE, /Close
file = 'idl.' + StrLowCase(!D.ps)

cmd = 'lpr ' + file

If N_Elements(New_file) GT 0 then $
   cmd = cmd + '; mv' + file + ' ' + New_file

Spawn, cmd

END

 For documentation on how this works, see page 98, of the IDL Reference Guide, Printing Graphics Output Files.