Chapter Contents


SAS/GRAPH Software: Reference

Displaying Graphics Output on Monitors or Terminals

If you want to see your graphics output immediately or preview it before generating a hardcopy, you can send it to your monitor or terminal.

Note:   If you are using a terminal or PC that emulates a terminal, it must be a graphics terminal.  [cautionend]

In most environments, SAS/GRAPH automatically displays graphics output in the GRAPH window. If your environment does not support the GRAPH window, SAS/GRAPH displays your graphs with the direct display method. See Displaying Graphs with Direct Display.

You can suppress the display of graphics output with the NODISPLAY graphics option. Suppressing a display is useful when you want to create only a catalog entry.

Displaying Graphs with the GRAPH Window

The GRAPH window, which is available in the SAS windowing environment, displays catalog entries of type GRSEG. You can use this window to view either the graphics output that you are currently generating or graphics output that has been stored in a catalog. You can scroll backward and forward through the catalog entries.

Some devices allow you to use up to four graph windows: GRAPH1, GRAPH2, GRAPH3, and GRAPH4. By default, the GRAPH1 window displays the graphs in the default catalog, WORK.GSEG, or the catalog that you specified with the GOUT= option.

The GRAPH window acts like other SAS windows: you can resize it and move it, and you can submit global SAS window commands from it. For details on sizing windows, see the SAS documentation for your operating environment. For a description of SAS window commands, see SAS Language: Reference.

GRAPH window commands control how the graphs appear in the window. For a description of these commands, refer to the SAS Help facility for the GRAPH window.

Opening and Closing the GRAPH Window

The GRAPH Window opens automatically when you submit a procedure that produces graphics output, or when you select a catalog entry from the PROC GREPLAY window or from the SAS Explorer window. You can also open the GRAPH window with the GRAPHn command. The GRAPHn command opens the default catalog WORK.GSEG, or a catalog you specify, or a specific entry.

The GRAPHn command has the following form:

GRAPHn <<libref.> catalog-name <.entry-name <.GRSEG>>>

is a number from 1 to 4 that indicates which GRAPH window to open.

points to the library where the catalog is or will be stored.

is the name of the catalog whose contents you want to view. The default is WORK.GSEG. If the specified catalog does not contain any graphics entries, the window opens but is empty. The catalog assignment is temporary and remains in effect only while the GRAPH window remains open. To change the catalog, resubmit the GRAPHn command.

is the name of the catalog entry that you want to view. If you omit entry-name or the entry does not exist, the last graph in the catalog is displayed. If you specify entry-name, you must also supply the libref and catalog name.

is the type of catalog entry.

To close the GRAPH window, issue the END command.

Sizing the GRAPH Window

The default size of a GRAPH window depends on the display device.

Resizing the GRAPH window after you have displayed a graph can distort the graphs. If you replay a graph in a GRAPH window that is a different size from the size at which you created the graph, the graph may be distorted. Distortion occurs if the new HSIZE and VSIZE values do not maintain the width-to-height ratio of the original window.  [cautionend]

Doing any of the following may change the HSIZE and VSIZE values and consequently the size of the GRAPH window:

In addition, resizing the GRAPH window can reduce the number of cells available for the output. In order to display some types of graphs in a reduced GRAPH window, you may need to increase the number of cells either by using the HPOS= and VPOS= graphics options or by modifying the device driver. To ensure that graphs have an adequate number of cells, use a full-size GRAPH window when creating the graphs.You can then reduce the window to replay the graphs. For more information on dimensions and cell size, see About the Graphics Output Area.

If you create most or all of your graphs at the same size or with the same aspect ratio, you can avoid distortion if you size the window before you draw the graphs and then use the WSAVE command to save the position and dimensions of the window. If you resize the GRAPH windows and do not use the WSAVE command, the new size is not saved, even in the same SAS session.

Displaying Graphs with Direct Display

Environments that do not support the GRAPH window use the direct display method. With this method, your display is cleared and the graph appears when you run a graphics procedure.

If the procedure produces more than one graph, you are prompted to press ENTER between each graph for the next one to be displayed. To return to your program, press END or ENTER after the last graph.

You can display the graphs automatically and control the amount of time between each graph with the GWAIT= and NOPROMPT graphics options. GWAIT= specifies the number of seconds before the next graph is drawn. NOPROMPT suppresses the delay between the graphs displayed. In this case, SAS/GRAPH automatically returns to your program after the last graph displays. (See Graphics Options and Device Parameters Dictionary for a complete description of these graphics options.)

With the direct display method, you cannot scroll to other graphs in the catalog. To redisplay graphs, you must rerun the procedure or replay the catalog entries. For information on replaying graphs, see The GREPLAY Procedure.

Chapter Contents



Top of Page

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