Statistical Graphics Using ODS


Accessing Individual Graphs

If you are writing a paper or creating a presentation, you need to access your graphs individually. There are various ways to do this, depending on the ODS destination. Three particularly useful methods are as follows:

  • If you are viewing RTF output, you can simply copy your graphs from the viewer and paste them into a Microsoft Word document or PowerPoint slide.

  • If you are viewing HTML output, you can copy and paste your graphs from the viewer, or you can right-click the graph and save it to a file. For more information, see the section Specifying the Size and Resolution of Graphs.

  • You can save your graphs in image files and then include them in a paper or presentation. For example, you can save your graphs as PNG files and include them in an HTML document or in a paper that you are writing in LaTeX.

You can specify the graphics image format and the filename in the ODS GRAPHICS statement. You can specify the graph resolution by using the IMAGE_DPI= option in an ODS destination statement. For example, the following statements, when submitted before a procedure step that produces multiple graphs, save the graphs in PostScript files named myname.ps, myname1.ps, and so on:

ods _all_ close;
ods latex;
ods graphics on / outputfmt=ps imagename='myname';

The following statements save the graphs in PNG files with a resolution of 300 dots per inch (DPI):

ods _all_ close;
ods html image_DPI=300;
ods graphics on;

For more information about the file types available with various destinations, how they are named, and how they are saved, see the section Image File Types. For more information about resolution, see the section Specifying the Size and Resolution of Graphs. For more information about scalable vector graphics, see the section Scalable Vector Graphics. If you are using the LISTING destination and the SAS windowing environment, you can copy from the viewer into a Microsoft Word document or PowerPoint slide.