Previous Page | Next Page

Introduction to SAS/GRAPH Software

Graph Types

SAS/GRAPH 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 also help you choose the correct type of graph for your data and point you to the appropriate chapter.


Charts

SAS/GRAPH 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.

[block chart]


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.

[horizontal bar chart]


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.

[vertical bar chart]


Pie charts, Detailed pie charts, 3D pie charts, and Donut charts

Pie charts, detailed 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.

Detailed Pie Chart

[detailed pie chart]

Donut Chart

[donut chart]


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.

[star chart]


Bar-line Charts

The GBARLINE procedure produces vertical bar charts with plot overlays. These charts graphically represent the value of a statistic calculated for one or more variables in an input SAS data set. The charted variables can be either numeric or character.

See The GBARLINE Procedure for a complete description.

[bar-line chart]


Area Bar Charts

The GAREABAR procedure produces area bar charts that show the magnitudes of two variables for each category of data. For example, the following area bar chart shows the sales total for each of three geographical sites. The width of each bar indicates the number of sales persons at each site. In a bar chart such as the chart shown in Vertical bar charts, the width is the same for each bar. In an area bar chart, the width and height of each bar is determined by the value of variables. See The GAREABAR Procedure for a complete description.

[area bar chart]


Tile Charts

The GTILE procedure produces charts that tile charts, which consist of a rectangle or square divided into tiles. The sizes of the individual tiles represent the value of the size variable. You can also specify a color variable, so that the colors of the individual tiles represent the magnitude of the color variable. Tile charts are useful for determining the relative magnitude of categories of data or the contribution of a category toward the whole.

[tile chart]


Radar Charts

The GRADAR procedure produces radar charts that show the relative frequency of data measures. On a radar chart, the chart statistics are displayed along spokes that radiate from the center of the chart. The charts are often stacked on top of one another with reference circles, thus giving them the look of a radar screen. Radar charts are frequently called star charts and are often used in quality control or market research problems.

See The GRADAR Procedure for a complete description.

[radar chart]


Two-Dimensional Plots

SAS/GRAPH 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.

[Two-dimensional scatter plot]


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.

[Simple line plot]


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 you can choose to display confidence limits for mean predicted values or individual predicted values.

[Regression plot]


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.

[High-low plot]


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.

[bubble plot]


Three-Dimensional Plots

SAS/GRAPH 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.

[surface plot]


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.

[scatter plot]


Contour plots

SAS/GRAPH 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.

[simple contour plot]

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 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 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.

[block map]


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.

[choropleth map]


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.

[prism map]


Surface maps

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

[gmap surface map]

SAS/GRAPH 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.


KPI Charts

The GKPI procedure creates graphical key performance indicator (KPI) charts. KPIs are metrics that help a business monitor its performance and measure its progress toward specific goals. The procedure produces five KPI chart types:

[five different types of KPI charts]


Creating Text Slide and Presentation Graphics

You can use SAS/GRAPH 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.

[text slide]


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

[Templated graph]

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 can also 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 can also 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

[Annotated map]


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 Kernel Standard (GKS); however, the interface is not an implementation of the GKS. The form is similar enough that many GKS-compliant programs can 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

Previous Page | Next Page | Top of Page