The ODS Graphics Editor is illustrated using the following example:
data growth; length Country $ 20; input country &$ GDP LFG EQP NEQ GAP; datalines; Argentina 0.0089 0.0118 0.0214 0.2286 0.6079 Austria 0.0332 0.0014 0.0991 0.1349 0.5809 ... more lines ... Zambia -0.0110 0.0275 0.0702 0.2012 0.8695 Zimbabwe 0.0110 0.0309 0.0843 0.1257 0.8875 ;
ods graphics on; ods html sge=on; proc robustreg data=growth plots=(ddplot histogram); model GDP = LFG GAP EQP NEQ / diagnostics leverage; output out=robout r=resid sr=stdres; run; ods _all_ close; ods listing;
The DATA and PROC ROBUSTREG steps are submitted to the SAS System, in this case from the SAS windowing environment, as shown
in Figure 21.17. Two versions of the graph are created: one in an uneditable PNG file (for example, DDPlot.png
) and one in an editable SGE file (for example, DDPlot.sge
). Both are saved in the SAS current folder. You can edit the graph in one of three ways:
In the Results window, double-click the second graph icon for the graph that you want to edit (see Figure 21.17). The second graph icon corresponds to the SGE file, and the first graph icon corresponds to the PNG file. Clicking the first graph icon invokes a host-dependent graph viewer (for example, Microsoft Photo Editor in Windows), not the ODS Graphics Editor. Note: The ODS Graphics Editor window might be hidden behind other windows in the SAS windowing environment.
You can edit the graph by selecting it in the SAS Explorer window. You must first navigate to the SAS current folder and to the SGE files.
You can open the graph from outside the SAS System. For example, if you are running SAS on the Windows operating system, you can click on the graph’s SGE file to open it by using the ODS Graphics Editor.
Figure 21.17: Results Window with Icons for Editable Plots
Figure 21.18 shows the ODS Graphics Editor window for the editable diagnostic plot that PROC ROBUSTREG creates. In Figure 21.19, various tools in the ODS Graphics Editor are used to modify the title and annotate a particular point. You can save the edited plot as a PNG file or an SGE file by selecting . After saving the plot, you can edit it again through the SAS Explorer window or by selecting from the ODS Graphics Editor window. Alternatively, you can reopen the saved plot for editing without first invoking the SAS System. For example, if you are running SAS on the Windows operating system, you can click on the plot to open it by using the ODS Graphics Editor.
The ODS Graphics Editor does not permit you to make structural changes to a graph (such as moving the positions of data points). The ODS Graphics Editor provides you with a point-and-click way to make one-time changes to a specific graph, whereas the template language (see the section Graph Templates in Chapter 22: ODS Graphics Template Modification) provides you with a programmatic way to make template changes that persist every time you run the procedure. For complete information about the tools available in the ODS Graphics Editor, see SAS 9.4 ODS Graphics Editor: User's Guide.
Figure 21.18: Diagnostic Plot before Editing
Figure 21.19: Diagnostic Plot after Editing