SAS Institute. The Power to Know

SAS/GRAPH(R) 9.2: Graph Template Language Reference

Previous | Next
Overview

ODS GRAPHICS Statement

The ODS GRAPHICS statement is used to modify the environment in which graphics templates are executed. It is somewhat like the GOPTIONS statement in intent, but it has no effect on legacy SAS/GRAPH output. Similarly, the GOPTIONS statement does not affect GTL-rendered graphs.

You use the ODS GRAPHICS statement to control

  • whether ODS graphics is enabled
  • the type and name of the image created
  • the size of the image
  • whether features such as scaling and anti-aliasing are used.

The ODS GRAPHICS statement has the following syntax:

  
 ODS GRAPHICS ON 
   < / RESET 
     IMAGEFMT= STATIC | GIF | PNG | JPEG | other-types 
     IMAGENAME= 'path-and-name' 
  /* default HEIGHT=480px, default WIDTH=640px */ 
     HEIGHT= size   WIDTH= size 
     SCALE= ON | OFF 
     BORDER= ON | OFF 
     ANTIALIASING = ON | OFF 
  /* IMAGEMAP produces tooltips for HTML destination only */ 
     IMAGEMAP = ON | OFF 
     more-options 
   >; 
   procedures or DATA steps 
  
 ODS GRAPHICS OFF;
 

The following ODS GRAPHICS statement uses the RESET option to prevent the output image name from incrementing (scatter1, scatter2, etc.) every time the graph is produced. The HEIGHT= and WIDTH= options are specified to set an aspect ratio for the output image.

  
 ods graphics on / reset 
     imagename="scatter" imagefmt=png 
                   height=175px width=200px; 
  proc sgrender data=sashelp.class 
                template=scatter; 
  run; 
 ods graphics off;
 

Previous | Next | Top of Page