Chapter Contents

Previous

Next
SAS/GRAPH Software: Reference

Generating Graphs

SAS/GRAPH software produces many kinds of charts, plots, and maps in both two- and three-dimensional versions. In addition to helping you understand the variety of graphs that are available to you, these descriptions will also help you choose the correct type of graph for your data and point you to the appropriate chapter.


Charts

SAS/GRAPH software uses the GCHART procedure to produce charts that graphically represent the value of a statistic for one or more variables in a SAS data set. See The GCHART Procedure for a complete description.

Block charts

Block charts use three-dimensional blocks to graphically represent values of statistics. Block charts are useful for emphasizing relative magnitudes and differences among data values.

[IMAGE]


Horizontal bar charts

Horizontal bar charts use horizontal bars to represent statistics based on the values of one or more variables. Horizontal bar charts can generate a table of chart statistics and are useful for displaying exact magnitudes and emphasizing differences.

[IMAGE]


Vertical bar charts

Vertical bar charts use vertical bars to represent statistics based on the values of one or more variables. Vertical bar charts, which generate only one statistic, are useful for displaying exact magnitudes and emphasizing differences.

[IMAGE]


Pie charts, 3-D Pie charts, and Donut charts

Pie charts, 3-D Pie charts, and Donut charts use the angle of pie slices to graphically represent the value of a statistic for a data range. Pie charts are useful for examining how the values of a variable contribute to the whole and for comparing the values of several variables.

[IMAGE]


Star charts

Star charts use the length of spines to graphically represent the value of a statistic for a data range. Star charts are useful for analyzing where data are out of balance.

[IMAGE]


Two-Dimensional Plots

SAS/GRAPH software uses the GPLOT procedure to produce two-dimensional graphs that plot one or more dependent variables against an independent variable within a set of coordinate axes. GPLOT can display the data points as individual symbols (as in a scatter plot), or use interpolation methods specified by the SYMBOL statement to join the points, request spline interpolation or regression analysis, produce various high-low plots, or generate several other types of plots.

GPLOT can also display data as bubble plots in which circles of different sizes represent the values of a third variable.

Plots are useful for demonstrating the relationship between two or more variables and frequently compare trends or data values or depict movements of data values over time.

See The GPLOT Procedure for a complete description.

Two-dimensional scatter plots

Two-dimensional scatter plots show the relationship of one variable to another, often revealing concentrations or trends in the data. Typically, each variable value on the horizontal axis can have any number of corresponding values on the vertical axis.

[IMAGE]


Simple line plots

Simple line plots show the relationship of one variable to another, often as movements or trends in the data over a period of time. Typically, each variable value on the horizontal axis has only one corresponding value on the vertical axis. The line connecting data points can be smoothed using a variety of interpolation methods, including the Lagrange and the cubic spline interpolation methods.

[IMAGE]


Regression plots

Regression plots specify that the plot is a regression analysis. You can specify one of three types of regression equation - linear, quadratic, or cubic - and optionally display confidence limits for mean predicted values or individual predicted values.

[IMAGE]


High-low plots

High-low plots show how several values of one variable relate to one value of another variable. Typically, each variable value on the horizontal axis has several corresponding values on the vertical axis. High-low plots include box, needle, and stock market plots.

[IMAGE]


Bubble plots

Bubble plots show the relative magnitude of one variable in relation to two other variables. The values of two variables determine the position of the bubble on the plot, and the value of a third variable determines the size of the bubble.

[IMAGE]


Three-Dimensional Plots

SAS/GRAPH software uses the G3D procedure to produce three-dimensional surface and scatter plots that examine the relationship among three variables. Variable values are plotted on a set of three coordinate axes.

See The G3D Procedure for a complete description.

Surface plots

Surface plots are three-dimensional plots that display the relationship of three variables as a continuous surface. Surface plots examine the three-dimensional shape of data.

[IMAGE]


Scatter plots

Scatter plots enable you to examine three-dimensional data points instead of surfaces and to classify your data using size, color, shape, or a combination of these features.

[IMAGE]


Contour plots

SAS/GRAPH software uses the GCONTOUR procedure to examine three-dimensional data in two dimensions. Lines or areas in a contour plot represent levels of magnitude (z) corresponding to a position on a plane (x,y).

See The GCONTOUR Procedure for a complete description.

Contour plots are two-dimensional plots that show three-dimensional relationships. These plots use contour lines or patterns to represent levels of magnitude of a contour variable plotted on the horizontal and vertical axes.

[IMAGE]

When you need to interpolate or smooth data values that are used by the G3D and GCONTOUR procedures, use the G3GRID procedure. The G3GRID procedure does not produce graphics output but processes existing data sets to create data sets that the G3D or GCONTOUR procedure can use to produce three-dimensional surface or contour plots. See The G3GRID Procedure for a complete description.


Maps

SAS/GRAPH software uses the GMAP procedure to produce two- and three-dimensional maps that can show an area or represent values of response variables for subareas.

SAS/GRAPH software includes data sets to produce geographic maps. In addition, you can create your own map data sets.

See The GMAP Procedure for a complete description.

Block maps

Block maps are three-dimensional maps that represent data values as blocks of varying height rising from the middle of the map areas.

[IMAGE]


Choropleth maps

Choropleth maps are two-dimensional maps that display data values by filling map areas with combinations of patterns and color that represent the data values.

[IMAGE]


Prism maps

Prism maps are three-dimensional maps that display data by raising the map areas and filling them with combinations of patterns and colors.

[IMAGE]


Surface maps

Surface maps are three-dimensional maps that represent data values as spikes of varying heights.

[IMAGE]

SAS/GRAPH software also provides several utility procedures for handling map data.

The GPROJECT procedure lets you choose how geographic maps are projected. This is particularly important for large areas because producing a map of any large area on the Earth involves distorting some areas in the process of projecting the spherical surface of the Earth onto a flat plane. You can use the procedure to select the projection method that least distorts your map.

Map areas are constructed of joined data points. Each data point represents an observation in a SAS data set. For large maps, the amount of data can be prohibitively expensive (in terms of computing resources or time to process); the GREDUCE procedure enables you to reduce the number of points in the data set. The GREMOVE procedure enables you to remove boundary lines within a map.


Creating Text Slide and Presentation Graphics

You can use SAS/GRAPH software to create slide presentations of your graphs. With SAS/GRAPH you can


Text Slides

Use the GSLIDE procedure to create text slides in which you can specify a variety of colors, fonts, sizes, angles, overlays, and other modifications as well as drawing lines and boxes on the output.

See The GSLIDE Procedure for a complete description.

Text slides display text as graphics output. Text slides can be used as title slides for presentations, or to produce certificates, signs, or other display text.

[IMAGE]

Use the GPRINT procedure to display as a graphic SAS procedure output that has been saved in a text file. With GPRINT, you bring the text file into SAS/GRAPH and then add titles, notes, and footnotes, and select colors for the output.

See The GPRINT Procedure for a complete description.

Combining Output into One Slide

Use the GREPLAY procedure to combine several graphs into a single output. You can create special effects by overlaying or rotating the graphs at any angle.

Templated graphs display two or more graphs or text slides as one output by replaying stored graphs into a template or framework. Like graphs and text slides, templated graphs can be ordered in groups and stored in catalogs for replay as part of a presentation.

Templated graphs

[IMAGE]

In addition, you can use the GREPLAY procedure to create an automated or user-controlled presentation of graphics output. The GREPLAY procedure enables you to name, arrange, and customize the presentation of graphs that are stored in a catalog.

See The GREPLAY Procedure for a complete description.


Enhancing Graphics Output (graphs and text slides)

SAS/GRAPH Statements

You also can use global statements and graphics options in SAS/GRAPH programs. With global statements, you can add titles and footnotes and control the appearance of axes, symbols, patterns, and legends. With graphics options, you can control the appearance of graphics elements by specifying default colors, fill patterns, fonts, text height, and so on.

The Annotate Facility

The Annotate facility enables you to program graphics by using certain variables in SAS data sets. It is often used to add text or special elements to the graphics output of other procedures, although it also can be used to construct custom graphics output. Text and graphics can be placed at coordinates derived from input data, as well as coordinates expressed as explicit locations on the display.

Annotated graphs

[IMAGE]


Creating Custom Graphics

The Annotate facility can also be used to generate custom graphics without using any of the SAS/GRAPH graphing procedures.

The DATA Step Graphics Interface

The DATA Step Graphics Interface provides functions and calls that produce graphics output from the DATA step, rather than from a procedure. The functions and calls are similar in form to those specified by the ISO Graphic Kernal Standard (GKS); however, the interface is not an implementation of the GKS. The form is similar enough that many GKS-compliant programs may be converted easily to run as SAS/GRAPH programs.

Graph-N-Go

To generate presentation graphs without writing any SAS/GRAPH code, you can use Graph-N-Go (not available on mainframes). You can start Graph-N-Go in several ways:

Information on using the application is in Graph-N-Go help, which you can access from the application's main window in either of two ways:

You can also get help for the application by submitting the following command from the SAS command line:

help gng


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.