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.
4
Work area
contains the graph that you want to edit or annotate.
5
Formatting toolbar
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.
See Also
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*/
/ group=sex;
run;
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.
4.
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.
See Also
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
the
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
available.
b.
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
1.
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

Get SAS® 9.3 ODS Graphics: Getting Started with Business and Statistical Graphics now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.