provides an easy way to select graph objects or to insert items into a graph. For more
information, see “About the Graph Toolbar” in Chapter 2 of SAS ODS Graphics
Editor: User's Guide.
contains the graph that you want to edit or annotate.
provides formatting tools that enable you to change the font, size, color, and other
attributes of text elements and annotations.
Note: This toolbar is active only if you have text or annotation objects selected in
your graph. The text element that you select might be a title, footnote, an axis
label, or a legend.
SAS ODS Graphics Editor: User's Guide
Example of Using the Editor
About This Example
This example shows how you might edit and annotate a graph that was created with the
SGPLOT procedure. These tasks use some of the toolbar functions previously described.
At the completion of the tasks in this example, the resulting graph is displayed:
Display 6.1 Edited and Annotated Graph Example
Example of Using the Editor 37
Step One: Create and Open an Editable Graph
1. In SAS, execute the following code. The SGE = ON option in the ODS destination
statement creates an editable graph.
ods html sge = on; /* enable editable graph creation */
proc sgplot data=sashelp.class; /* procedure statement */
scatter x=height y=weight /* plot statement with a group option*/
ods html sge = off; /* disable editable graph creation */
The SAS Results Viewer displays a scatter plot, shown here.
Your program also created an ODS Graphics Editor (SGE) file that you can edit.
2. Locate this SGE file by selecting View ð Results from the main menu.
3. Click the expansion icon in the SAS Results window to show the SGE file just
created with the SGPLOT procedure.
Double-click the SGE file, which is identified by the icon.
The ODS Graphics Editor opens and displays the graph for editing. You are now
ready to edit the graph using the various interactive tools built into the editor.
• For more information about the SGPLOT procedure, see Chapter 3, “Using the ODS
Graphics Procedures ,” on page 11.
• For more information about creating editable graphs, see “Creating Editable
Graphics ” in Chapter 2 of SAS ODS Graphics Editor: User's Guide.
Step Two: Add and Format a Title
1. To add a title, in the ODS Graphics Editor select Insert ð Title. Alternatively, click
Title icon in the Graph toolbar.
38 Chapter 6 • Using the ODS Graphics Editor
The Insert Title text box is displayed at the top of the graph.
2. Enter the text Study of Weight and Height in the text box.
3. Format the title that you just created.
a. In the Formatting toolbar at the top of the window, select the Arial Rounded
MT Bold font from the font drop-down list
Note: If the Formatting toolbar is dimmed, select the title to make the toolbar
Click the Bold button to undo the text boldface, and the Italic button to
italicize the text.
c. Press ENTER to preserve your formatting selections.
Step Three: Modify the Axis Labels
1. Double-click the Height X-axis label.
2. Move your cursor to the end of the text and type (IN).
3. Press ENTER to preserve the new text.
4. Double-click the Weight Y-axis label.
5. Move your cursor to the end of the text and type (LBS).
6. Press ENTER to preserve the new text.
Step Four: Add and Rotate a Text Annotation
Click the Text button in the Graph toolbar.
2. Click the area of the graph where you want to position your text—for example the
lower right quadrant of the graph. A text box appears.
3. Enter My annotation text in the box. The width of the text box determines the
maximum width of the text line. If a line exceeds the width of the text box, then the
text wraps to the next line. If needed, drag one of the circles on the border of the text
box to the right or left to widen the text box.
4. To rotate the text annotation, follow these steps:
a. Position your cursor in the circle above the text box.
The cursor changes to a rotated arrow.
b. Click and drag the rotated arrow to the left or right. You can rotate the entire box
anywhere within a 360 degree radius.
5. Click anywhere in the graph outside the text box to preserve the text.
Example of Using the Editor 39