User Guide > Getting Started: UNIX > Printing Your Work
  

Printing Your Work
PV‑WAVE supports a number of output devices and formats, such as PostScript printers, HPGL and PCL plotters, and Computer Graphics Metafiles (CGM). These output device drivers are described in detail in the PV‑WAVE Reference.
The five steps you take to produce graphics output are the same no matter which output device or format you use. The steps are:
*Select the graphics output device or format. (This automatically opens an output file.)
*Configure the output device to your specifications.
*Enter the PV‑WAVE commands to display your graphics
*Close the output file.
*Use a UNIX system command to send the output file to a printer or plotter.
For example:
; Select the graphics device.
SET_PLOT, ’ps’
; Configure the output device. This command specifies the output
; filename and the type of file — Encapsulated PostScript (EPS).
DEVICE, Filename=’myplot.ps’, /Eps
; Enter the graphics commands.
PLOT, INDGEN(100), Title=’Hello World’
; Close the device.
DEVICE, /Close
; Print command on a UNIX system. The dollar sign ($) is used to
; issue an operating system command from PV-WAVE.
$lpr myplot.ps
Each step is described in the following sections.
Selecting the Output Device with SET_PLOT
Select a graphics output device with the SET_PLOT command. The command is:
SET_PLOT, string
where string can be any one of the following letter codes:
*CGM—Computer Graphics Metafile format
*HP—HPGL device
*PCL—PCL device
*PS—PostScript device
For example, this command selects the PostScript device:
SET_PLOT, ps
Configuring the Output Device with DEVICE
Once the graphics output device has been selected, it is controlled or configured with the DEVICE command. The DEVICE command uses keywords to control the specific functions of each output device. Since each output device is unique, the number and names of keywords that are valid with the DEVICE command are different depending upon the device selected. For example, the DEVICE command for the PostScript device has 34 valid keywords, whereas the same DEVICE command for the Tektronix 4510 rasterizer has only 10 valid keywords.
The DEVICE keywords for each output device supported by PV‑WAVE are listed in the PV‑WAVE Reference.
If no DEVICE command is issued after the SET_PLOT command, then the device is configured with default values. To see the current configuration of any output device, issue the SET_PLOT command to select the device and then use the INFO command to obtain information about the device. For example, to learn the current configuration of the PostScript device, you would type the following:
SET_PLOT, ’ps’
INFO, /Device
Entering Graphics Commands for Output
After you have configured the output device to your specifications, you now enter appropriate graphics commands for the output you wish to produce. These are the same graphics commands you would issue if you were displaying output on a display screen. For example, any of the following graphics commands would be appropriate:
PLOT, mydata, Title='Available Light Measurement' 
TVSCL, my—image 
PLOTS, x, y, /Normal 
SHADE_SURF, peak, Shades=peak_colors
XYOUTS, 300, 450, ’Lost acreage’, /Device 
SURFACE, peak, Bottom=35, Color=248
Closing the Output File
Before the graphics output file can be sent to the printer or plotter it must be closed. For example, the following commands do not print a file, as you might expect:
SET_PLOT, ’ps’
PLOT, x, y
SPAWN, ’lpr wave.ps’
This attempt to print the file is premature. It fails because the file is still open within PV‑WAVE.
Files are closed automatically when you exit PV‑WAVE, but the best way to close an output file is to close it explicitly with the DEVICE command. After you enter the graphics commands for your desired graphics output, enter the following command to close the output file:
DEVICE, /Close
Sending the Output File to the Printer or Plotter
Once an output file has been closed, it can be sent to a printer or plotter in the normal way (e.g. with an lpr command in a UNIX environment). But it is often more convenient to send a file to a printer or plotter without exiting PV‑WAVE. The best way to do this is to use the “$” shortcut method for spawning an external process. For example, you could issue one or the other of the following two commands at the PV‑WAVE prompt to send a file named peak.ps to a PostScript printer:
(UNIX) 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.
 

Version 2017.1
Copyright © 2019, Rogue Wave Software, Inc. All Rights Reserved.