Lesson 3: Saving and Printing a Plot

In this lesson you will create a simple plot and save the plot to a file. After saving the plot, you will print the data using one of the print commands appropriate to your system.

To save and print your data, do the following:

1.Select the graphics device—postscript—with SET_PLOT.

SET_PLOT, 'ps' 

2. Configure the output device. This command specifies the output filename and the type of file—PostScript (PS). By default, the file is saved in the current working directory. To save it to another directory, either 'CD' into that directory before the DEVICE command or include the full directory path in the filename.

DEVICE, Filename='myplot.ps'

3. Enter the graphics commands that plot the data. Since the output device is now a file, no window appears with the plot. To see a plot, you will need to use the SET_PLOT command to reset the display device to a terminal appropriate to the system you are using.

PLOT, INDGEN(100), Title='Hello World'

4. Close the output file.

DEVICE, /Close

5. Print the file. Windows users may need third-party software, such as Ghostscript, to print the file on a printer.

WAVE> $lpr peak.ps

 

Note

If your PostScript printer looks like it is printing something, but nothing comes out, you may have forgotten to close the file before you sent it to the printer.