Previous Page | Next Page

The GCONTOUR Procedure

Example 2: Labeling Contour Lines, Modifying the Horizontal Axis, Modifying the Legend


Procedure features: AUTOLABEL, HAXIS, LEGEND
Data Set SASHELP.LAKE
Sample library member: GCTLABEL

[untitled graphic]

This example modifies Simple Contour to label contour levels with the AUTOLABEL option. The SYMBOL statement used with the AUTOLABEL option enables you to customize the attributes of the contour lines and labels.

In this example, SYMBOL1 and SYMBOL7 assign text labels, text fonts, text height, and text and line color for the first and seventh contour level lines. SYMBOL2-SYMBOL6 define the text height, and the text and line color for contour level lines 2-6.

Additionally, the LEGEND statement attributes are modified to reposition the legend closer to the data.

 Note about code
goptions reset=all border;
 Note about code
title1 "Lake Data";
footnote1 j=r "GCTLABEL";
 Note about code
symbol1 value="DEEP"
        color=red
        font="Arial Rounded MT Bold"
        height=.6;
symbol2 color=green
        height=.45;
symbol3 color=blue
        height=.45;
symbol4 color=orange
        height=.45;
symbol5 color=purple
        height=.45;
symbol6 color=magenta 
        height=.45;
symbol7 value="Shallow"
        color=navy 
        font="Arial Rounded MT Bold" 
        height=.7;
 Note about code
legend1 position=(right middle)
        label=(position=top)
        across=1;
 Note about code
axis1 order=(0 to 10 by 2) minor=none;
 Note about code
proc gcontour data=sashelp.lake;
   plot length*width=depth/
       autolabel=(check=none)
      haxis=axis1
      legend=legend1
      name="GCTLABEL";
   run;
quit;

Previous Page | Next Page | Top of Page