SASŪ Graphics
SAS has the ability to produce high-resolution, publication quality graphics
through the use of graphic procedures, SAS/Insight, SAS/Analyst and Graph-n-Go.
This section will discuss producing SAS graphics through programming.
SAS graphics are usually created using interactive SAS. If the graphic
output is redirected to a file or printer, graphics can also be created in
batch mode of SAS. See the SAS documentation for details.
When SAS graphics are used in interactive SAS, SAS allows multiple statements
to be run within the same procedure. Follow these statements with a RUN statement.
To top a procedure from running, use a QUIT statement. Note that sometimes this
interactivity is disabled when using a BY statement.
There are several graphics procedures available.
- GPLOT: Produce 2D scatter plots.
- GCHART: Produces vertical and horizontal bar charts,
block charts, pie and donut charts, and star charts.
- GCONTOUR: Produces contour plots displaying 3D data as 2D.
- GMAP: Produces 2D and 3D maps.
- GPRINT: Converts a text file into graphics output.
- GSLIDE: Produces text output as graphic output using
TITLE, NOTE and FOOTNOTE statements.
- G3D: Produces 3D graphs.
In addition to the graphics procedure, a GOPTIONS statement is available to
set specific graphic option defaults and several other graphic statements that
enhance the graphic output.
- GOPTIONS: Modifies graphic default options.
- SYMBOL: Modifies the shape and color of plot symbols,
the interpolation method for plot data and appearance of lines and labels.
- AXIS: Modifies the appearance, position and range
of values of axes in plots and charts.
- LEGEND: Modifies the appearance and position of
legends on plots and charts.
- PATTERN: Modifies the colors and fill patterns on
charts and maps.
GREPLAY is another SAS graphic procedure. However, it does not create new
plots, but instead "replays" graphics created by other procedures. Using
templates (SAS or self-defined), you can replay graphics to create slides/graphics
that contain more than one graphic. For example, you can create a new graphic
that contains 2 scatter plots, or 1 scatter plot and 1 histogram, or a text
graphic laid under a plot.