Chapter Contents

Previous

Next
The GCONTOUR Procedure

Example 1: Generating a Simple Contour Plot


Procedure features:
PLOT statement
Other features:
FORMAT statement
G3GRID procedure
Sample library member: GR14N01

[IMAGE]

This example shows a simple contour plot that describes the percentage of clay found in soil samples at various locations of a testing site. By default, the axes are scaled to include all data values and are labeled with the names of the axes variables. Values are plotted with seven contour levels, which are represented by contour lines with default colors and line types. The default contour levels occur at every 15th percent of the range between the contour variable's 5th and 95th percentile. The legend is labeled with the contour variable's name and identifies the contour levels that are included in the plot.

This example uses the G3GRID procedure to interpolate clay percentages for grid cells that do not have percentages in the data. Without the G3GRID procedure, there are too many missing values for the percentages, and the GCONTOUR procedure cannot produce a satisfactory contour plot.
 Note about code
libname reflib 'SAS-data-library';
goptions reset=global gunit=pct border cback=white
         colors=(black blue green red)
         ftext=swiss ftitle=swissb htitle=6 htext=4;
 Note about code
data reflib.clay;
   input x y pct_clay;
   datalines;
-10    -10       2.316
-10     -9       1.816
-10     -8       2.427
...more data lines...
 10      8        .
 10      9        .
 10     10        .
;
 Note about code
proc g3grid data=reflib.clay out=reflib.clay2;
   grid y*x=pct_clay / naxis1=21
                       naxis2=21
                       join;
run;
 Note about code
title1 'Clay Content at Site A';
footnote1 j=r 'GR14N01 ';
 Note about code
proc gcontour data=reflib.clay2;
   format pct_clay 2.0;
   plot y*x=pct_clay;
run;
quit;


Chapter Contents

Previous

Next

Top of Page

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