Previous Page | Next Page

Statistical Graphics Using ODS


ODS GRAPHICS <OFF | ON> </ options> ;

The ODS GRAPHICS statement enables ODS to create graphics. By default, ODS Graphics is not enabled. You can enable ODS Graphics by using either of the following equivalent statements:

   ods graphics on;
   ods graphics;

You specify one of these statements prior to your procedure invocation, as illustrated in the examples beginning with Default Plots for Simple Linear Regression with PROC REG. Any procedure that supports ODS Graphics then produces 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;

The following is a subset of the options, syntax, and capabilities available in the ODS GRAPHICS statement. See the SAS Output Delivery System: User's Guide for more information.


controls the use of antialiasing to smooth the components of a graph. Without antialiasing, pixels are simply set or not set. With antialiasing, pixels at the edge of a line or other object are set to an intermediate color, which makes smoother and more professional looking graphics. Text displayed in a graph is always antialiased. Antialiasing is very time consuming for larger graphical displays, and its benefits decrease as the number of points increases, so it is turned off by default for plots with many points. If the number of observations in the ODS output object exceeds the ANTIALIASMAX= threshold (10,000 by default), then antialiasing is not used, even if you specify the option ANTIALIAS=ON. The default is ANTIALIAS=ON.


specifies the maximum number of markers or lines to be antialiased before antialiasing is disabled. For example, if there are more than 10,000 point markers and ANTIALIASMAX=10,000 (the default), then no markers are antialiased.


specifies whether to draw the graph with a border. BORDER=ON is the default.


specifies the height of the graph. The default is HEIGHT=480PX (480 pixels). You can also specify height in inches (for example, HEIGHT=5IN) or centimeters (for example, HEIGHT=12CM).

IMAGEFMT=<image-file-type | STATIC>

specifies the image format for graphs. By default, IMAGEFMT=STATIC and ODS dynamically uses the best quality static image format for the active output destination. The available image formats include: BMP (Microsoft Windows device independent bitmap), DIB (Microsoft Windows device independent bitmap), EMF (Microsoft NT enhanced metafile), EPSI (Adobe encapsulated PostScript interchange), GIF (graphics interchange format), JFIF (JPEG file interchange format), JPEG (Joint Photographic Experts Group), PBM (portable bitmap), PCD (Photo CD), PDF (Portable Document Format), PICT (the QuickDraw Picture Format), PNG (Portable Network Graphic), PS (PostScript image file format), TIFF (tagged image file format), WMF (Microsoft Windows Metafile Format), XBM (X11 Bitmap graphics), and XPM (X11 Pixel Map graphics). If the specified image format is not valid for the active output destination, the device is automatically remapped to the default image format.


controls tooltip generation in the HTML destination. The default is IMAGEMAP=OFF, which means that no tooltips are generated. Tooltips are text boxes that appear in HTML output when you hover over a part of the plot with your mouse pointer (see Example 21.1).


specifies the base image file name. The default is the name of the output object. You can determine the name of the output object by using the ODS TRACE statement (see the section Determining Graph Names and Labels). The base image name should not include an extension. ODS automatically adds the increment value and the appropriate extension (which is specific to the output destination). See the section Specifying Base File Names for an example.


specifies the maximum number of labeled areas before labeling is disabled. For example, if LABELMAX=50, and there are more than 50 points with labels, then no points are labeled. The default is LABELMAX=200.


specifies the maximum percentage of the overall graph area that a legend can occupy. The default is MAXLEGENDAREA=20. Larger legends are dropped from the display.


resets one or more ODS GRAPHICS options to their default settings. The RESET and RESET=ALL options are equivalent. If you want to reset more than one option, but not all of the options, then you must specify RESET= separately for each option you reset (for example, ods graphics on / reset=antialias reset=index;). The RESET= options include the following:


resets all of the resettable options to their defaults.


resets the ANTIALIAS= option to its default.


resets the ANTIALIASMAX= option to its default.


resets the BORDER= option to its default.


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


resets the HEIGHT= option to its default.


resets the IMAGEMAP= option to its default.


resets the LABELMAX= option to its default.


resets the SCALE= option to its default.


resets the TIPMAX= option to its default.


resets the WIDTH= option to its default.


specifies whether the fonts and symbol markers are scaled proportionally with the size of the graph. The default is SCALE=ON. For examples, see Figure 21.29 and Figure 21.30.


specifies the maximum number of distinct tooltips permitted before tooltips are disabled. Tooltips are text boxes that appear when you hover over a part of the plot with your mouse pointer. For example, if TIPMAX=400, and there are more than 400 points in a scatter plot, then no tooltips appear. The default is TIPMAX=500.


specifies the width of the graph. The default is WIDTH=640PX (640 pixels). You can also specify widths in inches (for example, WIDTH=5in) or centimeters (for example, WIDTH=12cm).

Previous Page | Next Page | Top of Page