Previous Page | Next Page

SAS/GRAPH Output

Setting the Resolution of Your Graph

To set the resolution of your template-based graphics:

To set the resolution of your device-based graphics, use one of the following methods:


Using the XPIXELS=, XMAX=, YPIXELS=, and YMAX= Graphics Options to Set the Resolution for Device-Based Graphics

For devices other than the default display devices and the Universal Printer devices, you can use the XPIXELS=, XMAX=, YPIXELS=, and YMAX= graphics options to set the resolution of your graph.

Note:   The XPIXELS=, YPIXELS=, XMAX=, and YMAX= graphics options are not supported by the default display devices and the Universal Printer devices, including the shortcut devices. These graphics options are partially supported by the ACTIVEX and JAVA devices.  [cautionend]

Note:   The resolution of GIF and BMP images is fixed and cannot be changed using this method.  [cautionend]

The XPIXELS= and YPIXELS= graphics options set the number of pixels for the X and Y axes respectively. The XMAX= and YMAX= graphics options set the maximum boundaries of the output on the X and Y axes respectively. The SAS/GRAPH software computes the resolution as follows:

X-resolution = XPIXELS / XMAX

Y-resolution = YPIXELS / XMAX

Interactions of Graphics Options That Affect Resolution summarizes the affect of the XPIXELS=, XMAX=, YPIXELS=, and YMAX= graphics options have on the image resolution.

Interactions of Graphics Options That Affect Resolution
Options Specified Options Not Specified SAS/GRAPH Action
XPIXELS= and YPIXELS= XMAX= and YMAX= Changes the dimensions and recalculates the value of XMAX= and YMAX= in order to retain the resolution.
XMAX= and YMAX= XPIXELS= and YPIXELS= Changes the dimensions and recalculates the value of XPIXELS= and YPIXELS= in order to retain the resolution.
XMAX= and XPIXELS=
Changes the horizontal dimension and recalculates the resolution.
YMAX= and YPIXELS=
Changes the vertical dimension and recalculates the resolution.

For example, for the graphics option settings XPIXELS=800 and XMAX=8in, the resulting X resolution is 100 DPI.

You can set the X resolution, the Y resolution, or both. Here is an example that sets the resolution of a 1000-pixel-wide-by-1200-pixel-high TIFF image of a graph to 200 DPI.

option gstyle;
ods listing style=seaside;
goptions reset=all device=tiffp xpixels=1000 xmax=5in ypixels=1200 ymax=6in;

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


Using a Device Variant to Set the Size or Resolution of Your Graph

Some of the graphics output devices have variants that produce graphics of a specific size or resolution for a given format. GIF Device Variants that Produce Images of a Specific Size lists the GIF device variants that produce images of a specific size.

GIF Device Variants that Produce Images of a Specific Size
Device Variant Default Image Size
GIF160 160 x 120
GIF260 260 x 195
GIF373 373 x 280
GIF570 570 x 430
GIF733 733 x 550

The PNG300 and JPEG300 device variants produce 300 DPI images in the PNG and JPEG format respectively.

Note:   The PNG300 and JPEG300 devices are not appropriate for use with the ODS HTML destination. These devices are used when a high-resolution graph (300 DPI) in the PNG or JPEG format is required for printing purposes. Because most browsers do not use the resolution value stored in the PNG or JPEG file, images produced by the PNG300 and JPEG300 devices appear very large when they are viewed in the browser.  [cautionend]

See Overview.

Previous Page | Next Page | Top of Page