Concepts


About Contour Plots

Contour plots represent the levels of magnitude of a variable z , called the contour variable , for a position on a plane given by the values of two variables x and y . Contour lines of different colors and line types show different levels of magnitude of z for locations of x and y .

Display 30.1 on page 886 shows a simple contour plot that illustrates the percentage of clay found in soil samples at various locations of a testing site. The x and y axes on the plot represent a graph of surface height at various x-y locations. The contour lines within the plot represent the locations on the plane that have the clay percentages specified in the legend. The program for this plot is in Example 1 on page 904.

click to expand
Display 30.1: Sample Contour Plot

By default, the GCONTOUR procedure automatically scales the axes to include the maximum and minimum data values, labels each axis with the name of its variable or an associated label, and draws a frame around the plot. In addition, it plots values using seven contour levels of the contour variable, representing those levels with default colors and line types. Finally, it generates a legend that is labeled with the contour variable s name .

Parts of a Contour Plot

Some of the terms used in the discussion of the GCONTOUR procedure are illustrated in Figure 30.1 on page 887.

click to expand
Figure 30.1: GCONTOUR Procedure Terms

About the Input Data Set

The GCONTOUR procedure requires data sets that include three numeric variables: x , y , and z . The observations in the input data set should form a rectangular grid of x and y values and exactly one z value for each ( x , y ) combination. For example, data that contain 5 distinct values of x and 10 distinct values for y should be part of a data set that contains 50 observations with values for x , y , and z . If a single ( x , y ) grid location has more than one associated z value, only the last such observation appears in the plot.

Interpolating Additional Values

By default, the data set must contain values for the z variable for at least 50 percent of the grid in order for the GCONTOUR procedure to produce a satisfactory plot. If your data are clustered in relatively small patches over a larger study area, you can use the PROC GCONTOUR statement's INCOMPLETE option, which allows plotting of data when you have values for the z variable for less than 50 percent of the plot grid.

When the GCONTOUR procedure cannot produce a satisfactory contour plot because of missing values, the SAS/GRAPH software issues an error message, and no graph is produced. To correct this problem, you can use the G3GRID procedure to process data sets to be used by the GCONTOUR procedure. The G3GRID procedure interpolates the necessary values to produce a data set with nonmissing values of the z variable values for every combination of the x and y variables. The G3GRID procedure can also smooth data for use with the GCONTOUR procedure. For details, see Chapter 47, The G3GRID Procedure, on page 1327.

You can use the output data set from the G3GRID procedure as the input data set for the GCONTOUR procedure. For an example of using PROC G3GRID to interpolate values, see Example 1 on page 904.




SAS.GRAPH 9.1 Reference, Volumes I and II
SAS.GRAPH 9.1 Reference, Volumes I and II
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 342

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net