SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Enhancing and Exporting Charts and Plots
Sizing Graphs


Using the XPIXELS= and YPIXELS= Options

If you export your graphs directly to external files using program statements, use the XPIXELS= and YPIXELS= options to size your graphs. The XPIXELS= option specifies the width in pixels of the graphics output area, and the YPIXELS= option specifies the height in pixels of the graphics output area.


General form, XPIXELS= and YPIXELS= options:
XPIXELS=width-in-pixels

YPIXELS=height-in-pixels

where width-in-pixels and height-in-pixels are a positive integer up to eight digits long (0...99999999).


For example, the GOPTIONS statement below specifies both a height and width of 400 pixels. To add a border around the graph, use the BORDER option.
     filename piegif2 'g:\images\piechart2.gif';
goptions gsfname=piegif2 device=gif
xpixels=400 ypixels=400 border;
proc gchart data=clinic.stresstest;
pie tolerance; run;

The program above creates the following pie chart. The border outlines the graphics output area defined by XPIXELS= and YPIXELS=, and the overall graphic is 400 pixels high and 400 pixels wide.


Pie chart



back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement