Statistical Graphics Using ODS

Modifying Your Graphs

Although ODS Graphics is designed to automate the creation of high-quality statistical graphics, you might occasionally need to modify your graphs. There are two ways to do this, depending on whether the changes that you want to make are data-dependent and immediate (for a specific graph you are preparing for a paper or presentation) or persistent (applied to a graph each time you run the procedure). You can make immediate, ad hoc changes by using the ODS Graphics Editor, which provides a point-and-click interface. You can make persistent changes by modifying the ODS graph template for a particular plot. (For an introduction to graph template modification, see Chapter 22: ODS Graphics Template Modification.) A graph template is a program, written in the Graph Template Language (GTL), that specifies the layout and details of a graph.

Note: The SAS System provides a template for each graph that it creates, so you do not need to know anything about templates in order to create statistical graphics.

You can use the ODS Graphics Editor to customize titles and labels, annotate data points, add text, and change the properties of graph elements. After you modify your graph, you can save it as a PNG image file or an SGE file; the latter preserves the editing context. You can open SGE files by using the ODS Graphics Editor and resume editing.

You can invoke the ODS Graphics Editor in the SAS windowing environment, provided that you have enabled ODS Graphics to create editable graphs. The steps for doing this are described in the section ODS Graphics Editor. Also see SAS 9.4 ODS Graphics Editor: User's Guide.

Figure 21.15 shows the ODS Graphics Editor window for a fit plot that is created by PROC REG. Figure 21.16 shows modifications that are made by using tools in the ODS Graphics Editor. The title has been changed, and the legend has been repositioned.

Figure 21.15: ODS Graphics Editor Invoked to Edit a Fit Plot

ODS Graphics Editor Invoked to Edit a Fit Plot

Figure 21.16: Point-and-Click Modifications Made Using the ODS Graphics Editor

Point-and-Click Modifications Made Using the ODS Graphics Editor