ODS Graphics and SAS/GRAPH

SAS produces graphics using two very distinct systems: ODS Graphics and SAS/GRAPH. ODS Graphics and the GTL produce graphics through the Output Delivery System (ODS) using a template-based system. SAS/GRAPH produces graphics using a device-based system. You can use both systems to generate your graphical output. That is, you can use SAS/GRAPH to generate the output for some jobs, and ODS Graphics to generate the output for others. To help you understand the differences between the two systems in that case, here is a comparison:
  • The GTL does not produce GRSEGs or use device drivers. The output format that is produced is specified by the OUTPUTFMT= option in the ODS GRAPHICS statement. The GTL produces all output in industry standard output formats such as PNG, GIF, JPEG, WMF, TIFF, PDF, EMF, PS, PCL, and SVG. Most SAS/GRAPH procedures produce a GRSEG entry in a SAS catalog. Other output formats in SAS/GRAPH, such as an image or metagraphics file, can be created by selecting an appropriate device driver such as PNG, JPEG, or GIF.
  • The GTL has a layout-centric architecture. Each graph contains components such as plots, insets, and legends that can be combined in flexible ways inside layout containers to build complex graphs. Several layout types are available, some that produce a graph in a single cell and others that produce a graph as a panel of cells. In most cases, the components used in the single-cell graphs can also be used in the multi-cell graphs.
  • The GTL global options are specified in the ODS GRAPHICS statement or in the ODS destination statement. The GTL does not use the traditional SAS/GRAPH global statements, such as SYMBOL, PATTERN, AXIS, LEGEND, and GOPTIONS.
  • The GTL statements and options provide control over the visual properties of a graph. The SAS/GRAPH global statements such as GOPTIONS, AXIS, LEGEND, PATTERN, SYMBOL, and NOTE control the properties for text, markers, and lines.
  • The GTL controls the size, format, and name of output images with the HEIGHT=, WIDTH=, OUTPUTFMT=, and IMAGENAME= options in the ODS GRAPHICS statement. The ODS GRAPHICS statement is similar in purpose to the GOPTIONS statement. SAS/GRAPH controls the size and format of graphical output with options such as HSIZE=, VSIZE=, and DEVICE= in the GOPTIONS statement.
  • The GTL axes, backgrounds, titles, legends, and the other graph components are managed by the layout containers and do not belong to an individual plot.
  • Titles and footnotes produced by the SAS TITLE and FOOTNOTE statements do not appear in graphs that are generated using the GTL. The GTL has its own statements for producing titles and footnotes. (However, the SGPLOT, SGPANEL, and SGSCATTER procedures support the TITLE and FOOTNOTE statements. They generate GTL behind the scenes.)
  • The GTL plot type is determined by the plot statement. A plot statement is provided for each plot type. The SAS/GRAPH plot type is determined by global options for some graphs. For example, the INTERPOL= option in the SYMBOL statement might determine whether a graph is a scatter plot or a box plot.
  • The GTL graphical attributes for markers, lines, color, and so on, are derived by default from the active ODS style, which cannot be turned off. SAS/GRAPH also uses ODS styles by default. However, with SAS/GRAPH, the style can be turned off and the appearance information that is specified in the device entries used instead. For more information about ODS styles, see Managing Graph Appearance: General Principles.
  • The GTL supports all of the ODS destinations. For the LISTING destination, an image node is created for the graph in the Results tree. To view the graph, it must be manually opened in an external viewer or in the ODS Graphics Editor. SAS/GRAPH also supports all of the ODS destinations. However, for the LISTING destination, SAS/GRAPH creates a GRSEG node in the Results tree, and the image appears in the graph window automatically.
  • The GTL supports scaling of fonts and markers by default. This means that the sizes of fonts and markers are adjusted as appropriate to the size of your graph. Font and marker scaling is disabled by the NOSCALE option in the ODS GRAPHICS statement. SAS/GRAPH does not support scaling of fonts and markers.
  • The GTL does not support the SAS/GRAPH Annotate facility. The GTL draw statements can be used to add a variety of non-data-driven graphical elements such as annotations to graphs. For information about using the GTL draw statements, see Adding Non-Data-Driven Graphics Elements to a Graph. You can also use the ODS Graphics Editor to add annotations to your graphs. See SAS ODS Graphics Editor: User's Guide.
  • The GTL does not support RUN-group processing. SAS/GRAPH supports RUN-group processing for some procedures.