Previous Page | Next Page

SAS/GRAPH Statements

GOPTIONS Statement



Temporarily sets default values for many graphics attributes and device parameters used by SAS/GRAPH procedures.
Used by: all statements and procedures in a SAS session

Syntax
Description
Options
Using the GOPTIONS Statement
Graphics Option Processing

Syntax

GOPTIONS <options-list>;

options-list can be one or more options from any or all of the following categories:


Description

The GOPTIONS statement specifies values for graphics options. Graphics options control characteristics of the graph, such as size, colors, type fonts, fill patterns, and symbols. If GOPTIONS are specified, they override the default style. In addition, they affect the settings of device parameters, which are defined in the device entry. Device parameters control such characteristics as the appearance of the display, the type of output produced, and the destination of the output.

The GOPTIONS statement enables you to change these settings temporarily, either for a single graph or for the duration of your SAS session. You can use the GOPTIONS statement to do the following tasks:

To change device parameters permanently, you must use the GDEVICE procedure to modify the appropriate device entry or to create a new one. See The GDEVICE Procedure for details.

To review the current settings of all graphics options, use the GOPTIONS procedure. See The GOPTIONS Procedure for details.


Options

See Graphics Options and Device Parameters Dictionary for a complete description of all graphics options used by the GOPTIONS statement.


Using the GOPTIONS Statement

GOPTIONS statements are global and can be located anywhere in your SAS program. However, for the graphics options to affect the output from a procedure, the GOPTIONS statement must execute before the procedure.

With the exception of the RESET= option, graphics options can be listed in any order in a GOPTIONS statement. The RESET= option should be the first option in the GOPTIONS statement.

A graphics option remains in effect until you either specify the option in another GOPTIONS statement, or use the RESET= option to reset the values, or end the SAS session. When a session ends, the values of the graphics options return to their default values.

Graphics options are additive; that is, the value of a graphics option remains in effect until the graphics option is explicitly changed or reset or until you end your SAS session. Graphics options remain in effect even after you submit additional GOPTIONS statements specifying different options.

To reset an individual option to its default value, submit the option without a value (a null graphics option.) You can use a comma (but it is not required) to separate a null graphics option from the next one. For example, this GOPTIONS statement sets the values for background color, text height, and text font:

goptions cback=blue htext=6 pct ftext=albany;

To reset only the background color specification to the default and keep the remaining values, use this GOPTIONS statement:

goptions cback=;

To reset all graphic options to their default values, specify RESET=GOPTIONS:

goptions reset=goptions;

Alternatively, you can use RESET=ALL, but it also cancels any global statement definitions in addition to resetting all graphics options to default values.


Graphics Option Processing

You can control many graphics attributes through statement options, graphics options, device parameters, or a combination of these. SAS/GRAPH searches these places to determine the value to use, stopping at the first place that gives it an explicit value:

  1. statement options

  2. the value of the corresponding graphics option

  3. the value of a device parameter found in the catalog entry for your device driver

Note:   Not every graphics attribute can be set in all three places. See the statement and procedure chapters for the options that can be used with each.  [cautionend]

Some graphics options are supported for specific devices or operating environments only. See the SAS Help facility for SAS/GRAPH or the SAS companion for your operating environment for more information.

Previous Page | Next Page | Top of Page