Chapter Contents


SAS/GRAPH Software: Reference

Printing Graphics Output

You can print your SAS/GRAPH output on hardcopy devices such as laser printers and plotters. In addition, you can send the output to cameras or film recorders. Regardless of the destination, there are several ways to produce hardcopy of your SAS/GRAPH output:

The following sections provide a general description of these methods.

Operating Environment Information:   Whatever way you choose, the exact steps for printing graphics depend on the hardcopy device you are using and on the environment in which you are using it. For complete information on printing graphics output in your operating environment, see the SAS Help facility for SAS/GRAPH and the SAS companion for your operating environment.   [cautionend]

Printing Directly to the Device

You can send graphics output directly to a hardcopy device by sending the graphics commands directly to the device or to a device port.

On most systems you can use any of the following methods to print directly to a device:

For detailed instructions on each of these methods, refer to the SAS Help facility for SAS/GRAPH.

Saving and Printing a Graphics File

There are two steps to printing graphics output from an external file:

  1. Save your SAS/GRAPH output in an external file. For information on creating external files, see About Exporting SAS/GRAPH Output and the SAS Help facility for SAS/GRAPH.

  2. Print the file from your host environment. The host commands vary across operating environments and spooling utilities. See the SAS companion for your operating environment for more information on printing.

You can perform these two steps separately or combine them by incorporating the host printing commands into your program or device driver. In any case, you must choose a graphics file format that is compatible with your hardcopy device. For example, if you are using a PostScript printer, be sure to specify one of the PostScript device drivers supplied in SASHELP.DEVICES. This technique is frequently used on multi-user systems in which the output devices are shared.

You can use any of the following methods to create and print an external file:

For detailed instructions on each of these methods, refer to the SAS Help facility for SAS/GRAPH.

Printing From a Window

In some operating environments you can print directly from the GRAPH window or the Graphics Editor window by using the PRINT command in conjunction with the TARGETDEVICE= graphics option. To do this, use TARGETDEVICE= to specify the printer driver and use DEVICE= to specify the driver for the terminal or display on which you want to preview the output.

The driver specified by TARGETDEVICE= determines the characteristics of the printed output and sends the graphics output to either an output device or a graphics stream file. The driver specified by DEVICE= controls some characteristics of the output displayed in the window. In some cases, you may need to use a FILENAME and GOPTIONS statements to define the destination of the PRINT command.

Note:   If you have not previously specified TARGETDEVICE= when you issue the PRINT command in the window, SAS/GRAPH prompts you for a device for the printed output. However, in this situation the output that is sent to the printer reflects the characteristics of the display device driver. To ensure that your printed output matches what you see on your display, always use TARGETDEVICE= with the PRINT command.  [cautionend]

For details on printing directly from the GRAPH or Graphics Editor window, refer to the SAS Help facility for SAS/GRAPH. See TARGETDEVICE for a complete description of TARGETDEVICE=.

Previewing Output

If you want to preview how a graph is going to appear on another device before you send it to that device, you can use the TARGETDEVICE= graphics option. For example, to preview output on your display as it would appear on a color PostScript printer, include TARGETDEVICE= in a GOPTIONS statement and specify the driver for the printer:

goptions targetdevice=pscolor;

The output is displayed on your screen using

All other device parameter values, including the destination of the output, come from the current device entry. Therefore, the output displayed by TARGETDEVICE= may not be an exact replication of the actual output, but it is as close as possible.

See TARGETDEVICE for a complete description of TARGETDEVICE=.

Chapter Contents



Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.