Previous Page | Next Page

SAS/GRAPH Output

Setting the Size of Your Graph

You can use graphics options to control the size of your graph. Each device uses a default size for the graphics that they generate. You can use the HSIZE= and VSIZE= graphics options to override the default size of your graphics area, or the XPIXELS= and YPIXELS= graphics options to override the default size of your graph.


Using the HSIZE= and VSIZE= Graphics Options to Set the Size of Your Graphics Area

You can use the HSIZE= and VSIZE= graphics options to change the default size of the graphics area for the device that you are using. The HSIZE= option sets the horizontal dimension, while the VSIZE= option sets the vertical dimension. You can specify the dimension in inches (in), centimeters (cm), or points (pt). The default unit is inches (in). Here is an example that creates a 20 centimeter wide by 10 centimeter high GIF image of a graph.

option gstyle;
ods listing style=statistical;
goptions reset=all device=gif hsize=20cm vsize=10cm;

proc gchart data=sashelp.cars;
   vbar Make;
      where MPG_Highway >= 37;
   run;
quit;


Using the XPIXELS= and YPIXELS= Graphics Options to Set the Size of Your Graph

For devices other than the default display devices and the Universal Printing devices, you can use the XPIXELS= and YPIXELS= graphics options to change the default size of the display area for your graph without having to modify the device.

Note:   The XPIXELS= and YPIXELS= graphics options are not supported by the default display devices. They are also not supported by Universal Printer devices (including the shortcut devices). The options are partially supported by the ACTIVEX and JAVA devices.  [cautionend]

Setting only the XPIXELS= and YPIXELS= options affects the size of the graph, but does not affect the resolution. Here is an example that creates a 600 pixel wide by 800 pixel high GIF image of a graph.

option gstyle;
ods listing style=statistical;
goptions reset=all device=gif xpixels=600 ypixels=800;

proc gchart data=sashelp.cars;
   vbar Make;
      where MPG_Highway >= 37;
   run;
quit;

Notice that XMAX= and YMAX= are not set. In this example, the SAS/GRAPH software recomputes the XMAX= and YMAX= values to retain the original resolution for the new graph size.

Previous Page | Next Page | Top of Page