Chapter Contents

Previous

Next
The GCONTOUR Procedure

Example 2: Labeling Contour Lines


Procedure features:
PLOT statement options:
AUTOLABEL=
HAXIS=
LEGEND=
LEVELS=
VAXIS=
Other features:
AXIS statement
LEGEND statement
SYMBOL statement
Data set: REFLIB.CLAY2
Sample library member: GR14N02

[IMAGE]

This example modifies Generating a Simple Contour Plot to label contour levels with the AUTOLABEL option. When AUTOLABEL is used, the SYMBOL statement controls the labels and attributes of contour lines. In this example, SYMBOL1 defines a text label for the lowest contour level. Each remaining contour line gets the default label, which is the contour variable's value at that contour level. All the contour lines are solid, which is the default line type for the SYMBOL statement.

This example also uses AXIS statements to limit the plot to one of the contour areas from the output of Generating a Simple Contour Plot, and it uses a LEGEND statement to move the legend so the procedure has more room for displaying the y axis.
 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
title1 'Clay Content at Site A';
footnote1 j=r 'GR14N02 ';
 Note about code
axis1 order=(-10 to -4 by 2);
axis2 order=(-10 to 2 by 2);
 Note about code
legend1 position=(right middle)
        label=(position=top)
        across=1;
 Note about code
symbol1 height=2.5
        font=swissb
        value='lowest'
        color=red;
symbol2 height=2.5
        step=25pct
        color=black;
symbol3 height=2.5
        color=blue;
symbol4 height=2.5
        color=green;
 Note about code
proc gcontour data=reflib.clay2;
   plot y*x=pct_clay / levels=10 to 90 by 20
                       autolabel=(check=none)
                       haxis=axis1
                       vaxis=axis2
                       legend=legend1;
run;
quit;


Chapter Contents

Previous

Next

Top of Page

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