Previous Page | Next Page

Dictionary of ODS Language Statements

ODS GRAPHICS Statement



Enables or disables ODS graphics processing and sets graphics environment options. This statement affects ODS template-based graphics only. The ODS GRAPHICS statement does not affect device-based graphics.
Valid: anywhere
Category: ODS: Output Control
Default: The value of the SAS registry entry "ODS > STATISTICAL GRAPHICS > Default State", which is usually OFF.
Interaction: SAS/GRAPH device-based global statements such as GOPTIONS, SYMBOL, PATTERN, AXIS, and LEGEND do not affect template-based graphics. The ODS GRAPHICS statement does not affect device-based graphics.

Syntax
Without Arguments
Required Arguments
Options
Details
Using the ODS GRAPHICS Statement
Using the ODS GRAPHICS Statement for Batch Jobs
Supported Image File Types for Output Destinations
Description of Supported Image File Types

Syntax

ODS GRAPHICS <OFF | ON> </ option(s)>;


Without Arguments

If the ODS automatic graphic capabilities are currently disabled, then specifying the ODS GRAPHICS statement without options enables them. If the ODS automatic graphic capabilities are currently enabled, then specifying the ODS GRAPHICS statement leaves them enabled.


Required Arguments

ON

enables ODS Graphics processing. This is the default if no argument is used.

Alias: YES
OFF

disables ODS Graphics processing.

Alias: NO

Options

ODS GRAPHICS Option Summary Table
Task Option
Specify whether anti-aliasing is applied to the rendering of the line and markers in any graph ANTIALIAS= | ANTIALIAS | NOANTIALIAS
Specify the maximum number of markers or lines to be anti-aliased before anti-aliasing is disabled ANTIALIASMAX=
Specify whether to draw a border around each graph BORDER= | BORDER | NOBORDER
Specify the maximum number of discrete values to be shown in any graph DISCRETEMAX=
Specify the maximum number of group values to be shown in any graph GROUPMAX=
Specify the height of any graph HEIGHT=
Specify the image format used to generate image files IMAGEFMT=
Specify whether data tips are generated IMAGEMAP=| IMAGEMAP | NOIMAGEMAP
Specify the base image filename IMAGENAME=
Specify the maximum number of labeled areas before labeling is disabled LABELMAX=
Specify an integer that is interpreted as the maximum percentage of the overall graphics area that a legend can occupy MAXLEGENDAREA=
Specify the maximum number of cells in a graph panel where the number of cells is determined dynamically by classification variables PANELCELLMAX=
Reset one or more ODS GRAPHICS options to its default RESET | RESET=
Specify whether the content of any graph is scaled proportionally SCALE= | SCALE | NOSCALE
Specify the maximum number of distinct mouse-over areas allowed before data tips are disabled TIPMAX=
Specify the width of any graph WIDTH=

ANTIALIAS= | ANTIALIAS | NOANTIALIAS

specifies whether anti-aliasing is applied to the rendering of the line and markers in any graph. Anti-aliasing smooths the appearance of diagonal lines and some markers. Text displayed in the graph is always anti-aliased. For graphical displays that plot large numbers of points it is recommended that ANTIALIAS=OFF be specified for performance considerations.

ANTIALIAS= OFF | ON

specifies whether anti-aliasing is applied to the rendering of the line and markers in the graph.

OFF

does not smooth jagged edges of components other than text in the graph.

Alias: NO
ON

smooths jagged edges of all components in the graph.

Alias: YES
ANTIALIAS

smooths jagged edges of all components in the graph.

NOANTIALIAS

does not smooth jagged edges of components other than text in the graph.

Default: ON
Restriction: If the number of markers or curve points in the plot exceeds the number specified by the ANTIALIASMAX= option, then the ANTIALIAS option is turned off, even if you specify the option ANTIALIAS=ON or ANTIALIAS.
ANTIALIASMAX= n

specifies the maximum number of markers or lines to be anti-aliased before anti-aliasing is disabled. For example, if there are more than 400 scatterpoint markers to be anti-aliased and ANTIALIASMAX=400, then no markers will be anti-aliased.

n

specifies a positive integer.

Default: 600
BORDER= | BORDER | NOBORDER

specifies whether to draw a border around any graph.

BORDER= OFF | ON

specifies whether to draw the graph with a border on the outermost layout.

ON

specifies to draw a border around the graph.

Alias: YES
OFF

specifies not to draw a border around the graph.

Alias: NO
BORDER

specifies whether to draw a border around the graph.

NOBORDER

specifies not to draw a border around any graph.

Default: BORDER or BORDER=ON
DISCRETEMAX=n

specifies the maximum number of discrete values to be shown in any graph. Barcharts and box plots are examples of affected plot types. Scatter plots and other plot types can be affected if the data to be plotted is discrete or the axis is discrete.

n

specifies a positive integer.

Default: 1000
Tip: Some plot layers might be unaffected by the DISCRETEMAX= option, and those layers will still be rendered. If all layers are affected, a blank graph will be rendered.
Tip: If the value specified by the DISCRETEMAX= option is exceeded by any plot layer in the graph, that layer will not be drawn and a warning message is issued.
GROUPMAX=n

specifies the maximum number of group values to be shown in any graph. Any graph that supports the GROUP= option is affected.

n

specifies a positive integer.

Default: 1000
Tip: If the value specified by the GROUPMAX= option is exceeded by any plot layer in the graph, that layer will be rendered ignoring the GROUP= option and a warning message is issued.
HEIGHT=dimension

specifies the height of any graph.

dimension

is a nonnegative number.

See: dimension
Default: The value of the SAS registry entry "ODS > STATISTICAL GRAPHICS > Design Height" or the value of the DesignHeight= option in a STATGRAPH template. Typically, the value is 480px.
IMAGEFMT= image-file-type | STATIC

specifies the image format to be used. If the image format is not valid for the active output destination, the format is automatically changed to the default image format for that destination.

image-file-type

is the image format to be generated. See Supported Image File Types for Output Destinations.

STATIC

uses the best quality static image format for the active output destination. This is the default.

Default: STATIC
IMAGEMAP= | IMAGEMAP | NOIMAGEMAP

controls data tips generation. Data tips are pieces of explanatory text that appear when you mouse-over the data portions of a graph contained in an HTML page.

IMAGEMAP= ON | OFF

controls data tips generation.

OFF

specifies not to generate data tips.

Alias: NO
ON

specifies to generate data tips.

Alias: YES
IMAGEMAP

specifies to generate data tips.

NOIMAGEMAP

specifies not to generate data tips.

Default: OFF or NOIMAGEMAP
Restriction: This option applies only when the ODS HTML destination is used.
IMAGENAME="filename"

specifies the base image filename.

If more than one image is generated, each is assigned filename as a base name followed by a number in order to create unique names. This numbering can be reset with the RESET=INDEX option. Path information (if needed) can be set with the GPATH= option on the ODS destination statement. The default path is the current output directory. A file extension for filename is automatically generated based on the IMAGEFMT= option.

Requirement: You must enclose filename in quotation marks.
Restriction: filename must be a single name. It must not include any path specification or image-format name extension.
Default: The name of the output object.
LABELMAX= n

specifies the maximum number of labeled areas before labeling is disabled. For example, if there are more than 50 points to be labeled and LABELMAX=50, then no points will be labeled.

n

specifies a positive integer.

Default: 200
MAXLEGENDAREA= n

specifies an integer that is interpreted as the maximum percentage of the overall graphics area that a legend can occupy.

n

specifies a positive integer.

Default: 20
Tip: To turn off the legend, specify MAXLEGENDAREA=0. No warning will be issued when the legend is turned off in this way.
PANELCELLMAX=n

specifies the maximum number of cells in a graph panel where the number of cells is determined dynamically by classification variables.

n

specifies a positive integer.

Default: 10000
Tip: Graphs with DataPanel or DataLattice layouts are affected. If the value specified by the PANELCELLMAX= option is exceeded by either of these layouts, an empty graph will be rendered and a warning message is issued.
RESET | RESET= option

resets one or more ODS GRAPHICS options to its default.

RESET

resets all of the options to their defaults.

RESET=

resets one of the following to its default:

ALL

resets all of the reset-options to their defaults.

ANTIALIAS

resets the ANTIALIAS option to its default.

See also: ANTIALIAS=
ANTIALIASMAX

resets the ANTIALIASMAX option to its default.

See also: ANTIALIASMAX
BORDER

resets the BORDER= option to its default.

See also: BORDER=
IMAGEMAP

resets the IMAGEMAP= option to its default.

INDEX

resets the index counter that is appended to static image files.

HEIGHT

resets the HEIGHT= option to its default.

See also: HEIGHT=
IMAGEMAP

resets the IMAGEMAP= option to its default.

Note:   Not all output destinations support this feature.   [cautionend]

See also: IMAGEMAP=
LABELMAX

resets the LABELMAX= option to its default.

See also: LABELMAX=
MAXLEGENDAREA=

resets the LABELMAX= option to its default.

See also: MAXLEGENDAREA=
SCALE

resets the SCALE= option to its default.

See also: SCALE=
TIPMAX

resets the TIPMAX= option to its default.

See also: TIPMAX =
WIDTH=

resets the WIDTH= option to its default.

SCALE= | SCALE | NOSCALE

specifies whether the content of any graph is scaled proportionally.

NOSCALE

does not scale the components of graph proportionally.

SCALE

scales the components of graph proportionally.

SCALE=

specifies whether the content of the graph is scaled proportionally.

OFF

does not scale the components of graph proportionally.

Alias: NOSCALE
Alias: NO
ON

scales the components of graph proportionally.

Alias: YES
Default: ON or SCALE
TIPMAX=n

specifies the maximum number of distinct mouse-over areas allowed before data tips are disabled. For example, if there are more than 400 points in a scatterplot, and TIPMAX=400, then no data tips will appear.

n

specifies a positive integer.

Default: 500
WIDTH=dimension

specifies the width of any graph.

dimension

is a nonnegative number.

Default: The value of the SAS registry entry "ODS > STATISTICAL GRAPHICS > Design Width" or the value of the DesignWidth= option in a STATGRAPH template. Typically, this value is 640px.
See: dimension

Details


Using the ODS GRAPHICS Statement

You can enable ODS graphics by using either of the following equivalent statements:

ods graphics on;
ods graphics;

When you specify one of these statements before your procedure invocation, Base, SAS/STAT, SAS/ETS, and SAS/QC procedures support ODS graphics, either by default or when you specify procedure options for requesting particular graphs.

To disable ODS graphics, specify the following statement:

ods graphics off; 

Note:   For SAS/GRAPH procedures that use ODS graphics (SGPLOT, SGPANEL, SGSCATTER, and SGRENDER), ODS graphics is always ON and cannot be disabled. For other products, the initial state ODS graphics is determined by a SAS Registry setting.  [cautionend]


Using the ODS GRAPHICS Statement for Batch Jobs

To generate ODS graphics output in UNIX batch jobs, you must set the DISPLAY system option before creating the output. To set the display, enter the following command:

export DISPLAY=<ip_address>:0

The ip_address is the TCP/IP address, or the name of a UNIX terminal. Usually, the IP address of the UNIX system where SAS is running would be used. If you do not set the DISPLAY variable, then you get an error message in the SAS log.


Supported Image File Types for Output Destinations

The following table lists all of the supported image file types for ODS output destinations.

Output Destination Supported Image File Types
HTML PNG (default), GIF, JPEG, JPG
LISTING PNG (default), BMP, DIB, EMF, EPSI, GIF, JFIF, JPEG, JPG, PBM, PDF, PS, SASEMF, STATIC, TIFF, WMF
LATEX PS(default), EPSI, GIF, PNG, PDF, JPG
PRINTER Family PNG(default), JPEG, JPG, GIF
RTF PNG(default), JPEG, JPG, JFIF
Markup Tagsets All Markup family tagsets have the default imagefmt value built in.


Description of Supported Image File Types

Description of Supported Image File Types
Image File Type Description
BMP (Microsoft Windows Device Independent Bitmap) Supports color-mapped and true color images that are stored as uncompressed or run-length encoded data. BMP was developed by Microsoft Corporation.
DIB (Microsoft Windows Device Independent Bitmap) See the description of BMP. DIB is supported only under the OS/2 operating system.
EMF (Microsoft NT Enhanced Metafile) Supported only under Windows 95, Windows 98, and Windows NT.
EPSI (Microsoft NT Enhanced Metafile) An extended version of the standard PostScript (PS) format. Files that use this format can be printed on PostScript printers and can also be imported into other applications. Notice that EPSI files can be read, but PS files cannot be read.
GIF (Graphics Interchange Format) Supports only color-mapped images. GIF is owned by CompuServe, Inc.
JFIF (JPEG File Interchange Format) Supports JPEG image compression. JFIF software is developed by the Independent JPEG Group.
JPEG or JPG (Joint Photographic Experts Group) A file format that is used for storing noninteractive images.
PBM (Portable Bitmap Utilities) Supports gray, color, RGB, and bitmap files. The Portable Bitmap Utilities are a set of free utility programs that were developed primarily by Jef Poskanzer.
PDF (Portable Document Format) A file format for electronic distribution and exchange of documents.
PNG (Portable Network Graphic) Supports true color, gray-scale, and 8-bit images.
PS (PostScript Image File Format) The Image classes use only PostScript image operators. A level II PS printer is required for color images. PostScript was developed by Adobe Systems, Inc.
SASEMF (Enhanced Metafile) EMF image tuned for RTF output.
STATIC Chooses the best image format for the current ODS destination.
TIFF (Tagged Image File Format) Internally supports a number of compression types and image types, including bitmapped, color-mapped, gray-scaled, and true color. TIFF was developed by Aldus Corporation and Microsoft Corporation and is used by a wide variety of applications (available if licensed).
WMF (Microsoft Windows Metafile) Supported only under MicroSoft Windows operating systems.

Previous Page | Next Page | Top of Page