| TEMPLATE Procedure: ODS Graphics Overview (Experimental) |
| Getting Started |
In SAS 9.1, a number of statistical procedures have been modified to use an experimental extension to the Output Delivery System (ODS) that enables the procedures to create statistical graphics as automatically as tables. This facility is referred to as ODS Statistical Graphics (or ODS Graphics for short), and it is invoked when you provide the experimental ODS GRAPHICS statement prior to your procedure statements. Any procedures that use ODS Graphics then create graphics, either by default or when you specify procedure options for requesting specific graphs.
With ODS Graphics, a SAS procedure creates the graphs that are most commonly needed for a particular analysis. In many cases, graphs are automatically enhanced with useful statistical information or metadata, such as sample sizes and p-values, which are displayed in an inset box. Using ODS Graphics eliminates the need to save numerical results in an output data set, manipulate them with a DATA step program, and display them with a graphics procedure.
If you are using ODS Graphics for the first time, begin by reading "Statistical Graphics Using ODS" in SAS/STAT User's Guide, which illustrates the use of ODS Graphics, and provides general information on managing your graphics. Additional examples are given in the sections for procedures that use ODS Graphics in SAS 9.1.
| ODS Graphics Are Output Objects |
In many ways, creating graphs with ODS is analogous to creating tables with ODS. You can use the following language elements:
procedure options and defaults to determine which graphs are created
ODS destination statements (such as ODS HTML) to specify the output destination for graphs
graph names in ODS SELECT and ODS EXCLUDE statements to select or exclude graphs from your output
ODS styles to control the general appearance and consistency of all graphs
ODS templates to control the layout and details of individual graphs
Note: A default template is provided by SAS for each graph.
HTML
LATEX
PRINTER
RTF
| Customizing ODS Graphics- If You Must! |
In common applications of procedures that use ODS Graphics, the default graphs should suffice. However, when modifications become necessary, you can customize a particular graph by changing its template definition. As with table definitions, you can access ODS statistical graph definitions and modify them with the TEMPLATE procedure. For more information, see the section about customizing ODS Graphics by using templates in the SAS/STAT User's Guide.
ODS statistical graph definitions are written in an experimental graph template language, which has been added to the TEMPLATE procedure in SAS 9.1. The language elements include statements for specifying plot types (such as scatter plots and histograms), plot layouts, and text (such as titles and insets). Also, support for built-in computations (such as histogram binning) and evaluation of computational expressions is provided. Options are available for specifying colors, marker symbols, and other aspects of plot features.
Ordinarily, you should not need to modify ODS templates for graphs, just as you do not need to modify templates for tables.
The graph template language is primarily used by SAS developers to construct SAS-supplied templates for graphics created by statistical procedures. A secondary role of the graph template language is to enable you to modify the templates which SAS supplies.
Note: The graph template language is not a stand-alone mechanism for creating highly customized graphics displays (such as the Annotate facility in SAS/GRAPH).
The purpose of this document is to provide syntax details about the graph template language of the TEMPLATE procedure.