| Key Concepts |
Although the ODS GRAPHICS statement is not among the requirements listed in "Minimum Requirements to Generate a Plot", it manages the settings of the ODS Graphics environment and is a statement you will probably use frequently in your SAS sessions. For example, the ODS GRAPHICS statement provides options that control the physical aspects of your graphs, such as the image size and the name of the image file that is created for the graph.
The default image size of 640 pixels by 480 pixels (4:3 aspect ratio) for ODS Graphics is set in the SAS Registry. You can change the image size using the WIDTH= and/or HEIGHT= options on the ODS GRAPHICS statement. To name the output image file, use the IMAGENAME= option.
The following ODS GRAPHICS statement sets a 320 pixel width for the graph and names the output image file modelfit :
ods graphics / width=320px
imagename="modelfit" reset;
proc sgrender data=sashelp.class template=modelfit;
run;
ods graphics off;
In general, it is good practice to specify only one sizing option without the other - just the WIDTH= option or just the HEIGHT= option. That way SAS will maintain the design aspect ratio of the graph, which may be important for many graphs. For example, a graph that has multiple columns or a statistics table on the side needs a wide aspect ratio. Specifying both width and height in such cases may produce unpredictable results.
Note. Size settings on the ODS GRAPHICS statement affect all of the graphs that are rendered in the SAS session, unless they are changed by another ODS GRAPHICS statement. The size for a graph produced by an individual template can be set with the DESIGNWIDTH= and DESIGNHEIGHT= options on the BEGINGRAPH statement. Size settings on the ODS GRAPHICS statement override size settings on the BEGINGRAPH statement and remain in effect unless they are changed on another ODS GRAPHICS statement or ODS GRAPHICS are turned off.
For more information on using the ODS GRAPHICS statement, see the usage guide.
Copyright © 2007 by SAS Institute Inc., Cary, NC, USA. All rights reserved.