Procedure Syntax


Requirements: At least one PLOT statement is required.

Global statements: AXIS, FOOTNOTE, GOPTIONS, LEGEND, PATTERN, SYMBOL, TITLE

Reminder: The procedure can include the BY, FORMAT, LABEL, NOTE, and WHERE statements.

Supports: Output Delivery System (ODS)

PROC GCONTOUR <DATA= input-data-set >

  • <ANNOTATE= Annotate-data-set >

  • <GOUT=< libref. > output-catalog >

  • <INCOMPLETE>;

  • PLOT plot-request </ option(s) >;

PROC GCONTOUR Statement

Identifies the data set that contains the plot variables . Optionally specifies annotation and an output catalog.

Requirements: An input data set is required.

PROC GCONTOUR <DATA= input-data-set >

  • <ANNOTATE= Annotate-data-set >

  • <GOUT=< libref. > output-catalog >

  • <INCOMPLETE>;

ANNOTATE= Annotate-data-set

ANNO= Annotate-data-set

  • specifies a data set to annotate all graphs produced by the GCONTOUR procedure. To annotate individual graphs, use ANNOTATE= in the action statement.

    See also: Chapter 24, Using Annotate Data Sets, on page 587

DATA= input-data-set

  • identifies the SAS data set that contains the variables to plot. By default, the procedure uses the most recently created SAS data set.

    See also: SAS Data Sets on page 29 and About the Input Data Set on page 887.

GOUT=< libref .> output-catalog

  • specifies the SAS catalog in which to save the graphics output produced by the GCONTOUR procedure. If you omit the libref, the SAS/GRAPH software looks for the catalog in the temporary library called WORK and creates the WORK catalog if it does not exist.

    See also: Creating and Specifying Catalogs on page 54

    Not supported by: Java, ActiveX

INCOMPLETE

  • allows plotting of data when values are missing for more than half of the variables in the data set.

    Not supported by: Java, ActiveX

PLOT Statement

Creates contour plots using values of three numeric variables from the input data set as the source of the contour coordinates.

Requirements: A plot request is required.

Global statements: AXIS, FOOTNOTE, LEGEND, PATTERN, SYMBOL, TITLE

Description

The PLOT statement specifies the three variables to plot. Optionally, it controls the contour levels, labels the plot lines, and modifies axes as well as the general appearance of the graph. Only one plot request can be specified in a PLOT statement. To specify multiple plots for a single PROC GCONTOUR statement, use multiple PLOT statements.

The PLOT statement automatically

  • plots the values using seven contour levels of the z variable

  • scales the axes to include the maximum and minimum data values

  • labels the x and y axes and displays the contour levels in the plot's legend

  • draws a frame around the plot.

You can use global statements to modify the axes, the legend, the contour lines and contour line labels, and the fill patterns and pattern colors for contour areas. You can also add titles, footnotes, and notes to the chart, and you can use an Annotate data set to enhance the appearance of the chart.

PLOT plot-request </ option(s) >;

Required Arguments

y*x=z

  • specifies three numeric variables from the input data set:

    y

    is the variable that is plotted on the vertical axis.

    x

    is the variable that is plotted on the horizontal axis.

    z

    is the variable that is plotted as contour lines, on the Z axis, which is perpendicular to the plane formed by the X and Y axes.

Options by Category

option(s) can be one or more options in the following categories:

  • appearance options:

    • ANNOTATE= Annotate-data-set

    • CAXIS= axis- color

    • CFRAME= background-color

    • COUTLINE= outline-color

    • CTEXT= text-color

    • GRID

    • NOAXIS NOAXES

    • NOFRAME

  • horizontal axis options:

    • AUTOHREF

    • CAUTOHREF= reference-line-color

    • LAUTOHREF= reference-line-type

    • CHREF= reference-line-color ( reference-line-color ) reference-line-color-list

    • HAXIS=AXIS<1 99>

    • HMINOR= number-of-minor- ticks

    • HREF= value-list

    • HREVERSE

    • LHREF= reference-line-type ( reference-line-type ) reference-line-type-list

    • XTICKNUM= number-of-ticks

  • vertical axis options:

    • AUTOVREF

    • CAUTOVREF= reference-line-color

    • CVREF= reference-line-color ( reference-line-color ) reference-line-color-list

    • LAUTOVREF= reference-line-type

    • LVREF= reference-line-type ( reference-line-type ) reference-line-type-list

    • VAXIS=AXIS<1 99>

    • VMINOR= number-of-minor-ticks

    • VREF= value-list

    • VREVERSE

    • YTICKNUM= number-of-ticks

  • contour options:

    • CLEVELS= color(s)

    • JOIN

    • LEGEND=LEGEND<1 99>

    • LEVELS= value-list

    • LLEVELS= line-type-list

    • NLEVELS= number-of-levels

    • NOLEGEND

    • PATTERN

  • labeling options:

    • AUTOLABEL AUTOLABEL=( autolabel-suboptions )

      • where autolabel-suboptions can be one or more of these:

        • CHECK= checking-factor NONE

        • MAXHIDE= amount < units >

        • REVEAL

        • TOLANGLE= angle

  • catalog entry description options:

    • DESCRIPTION= entry-description

    • NAME = entry-name

Options

You can specify any of the following options in your PLOT statement, in any order. If you use a BY statement on the procedure, the options in each PLOT statement affect all graphs produced by that BY statement.

ANNOTATE= Annotate-data-set

ANNO= Annotate-data-set

  • specifies an Annotate data set to enhance the charts produced by the PLOT statement.

    See also: Chapter 26, The GANNO Procedure, on page 707 and Chapter 25, Annotate Dictionary, on page 613.

AUTOHREF

  • displays reference lines at major tick marks on the horizontal axis. The positions of the major tick marks are determined by the HAXIS= or XTICKNUM= option. To specify colors and line types for these reference lines, use the CAUTOHREF= and LAUTOHREF= options. To specify labels for these reference lines, use the HAXIS= option.

    Not supported by: Java

AUTOLABEL AUTOLABEL=( autolabel_suboptions )

  • automatically labels the contour lines. Autolabel-suboptions Autolabel Suboptions on page 898 allow you to control the appearance of these labels.

    The label for each contour line is the value of the z variable for that contour level. By default, labels are displayed in BEST format. To change the format, use a FORMAT statement.

    When AUTOLABEL is used, the LLEVELS= and CLEVELS= options are ignored and the SYMBOL SYMBOL Statement on page 183 statement controls label text and contour-line attributes.

    Even though AUTOLABEL labels the contour lines, a default legend is still generated. To suppress the legend, use the NOLEGEND option.

    Featured in: Example 2 on page 906

    Not supported by: Java, ActiveX

AUTOVREF

  • displays reference lines at major tick marks on the vertical axis. The number of major tick marks is determined by the VAXIS= or YTICKNUM= option. To specify colors and line types for these reference lines, use the CAUTOVREF= and LAUTOVREF= options. To specify labels for these reference lines, use the VAXIS= option.

    Not supported by: Java.

CAUTOHREF= reference-line-color

  • specifies a color for reference lines drawn at major tick marks on the horizontal axis, as specified by the AUTOHREF option. The default color for reference lines is determined by the CAXIS= option or by the first color in the color list. To specify line types for these reference lines, use the LAUTOHREF= option. To specify labels for these reference lines, use the HAXIS= option.

CAUTOVREF= reference-line-color

  • specifies a color for reference lines drawn at major tick marks on the vertical axis, as specified by the AUTOVREF option. The default color for reference lines is determined by the CAXIS= option or by the first color in the color list. To specify line types for these reference lines, use the LAUTOVREF= option. To specify labels for these reference lines, use the VAXIS= option.

    Not supported by: Java

CAXIS= axis-color

  • specifies a color for axis lines, tick marks, and reference lines. By default, axes are displayed in the second color in the colors list.

    If you use the CAXIS= option, it may be overridden by the COLOR= suboption of the MAJOR= or MINOR= option in an AXIS definition.

CFRAME= background-color

CFR= background-color

  • fills the axis area with the specified color and draws a frame around the axis area.

CHREF= reference-line-color ( reference-line-color ) reference-line-color-list

CH= reference-line-color ( reference-line-color ) reference-line-color-list

  • specifies the color of reference lines drawn perpendicular to the horizontal axis. Specifying a single color without parentheses applies that color to all reference lines drawn with the AUTOHREF and HREF= options. Note that the CAUTOHREF= option overrides the CHREF= option for lines drawn with the AUTOHREF option. Specifying a single color in parentheses applies that color only to the first reference line drawn with the HREF= option. Specifying a color list applies colors sequentially to successive reference lines drawn with the HREF= option. The syntax of the color list is of the form ( color1 color2 colorN ) or ( color1 , color2 , colorN ). Default colors for reference lines are determined by the CAXIS= option or by the first color in the color list. To specify line types for these reference lines, use the LHREF= option. To specify labels for these reference lines, use the HAXIS= option.

    Not supported by: Java

CLEVELS= color(s)

  • specifies a list of colors for plot contour levels. The number of specified colors should correspond to the number of contour levels since one color represents each level of contour. If fewer colors are specified than the number of levels in the plot, the procedure provides default colors from the current colors list. The procedure default is to rotate through the current colors list for each line type.

    This option is ignored if AUTOLABEL is used.

COUTLINE= outline-color

  • specifies a color for outlining filled areas. This option is ignored unless the PATTERN option is also used. By default, the outline color is the same as the color of the filled area.

    The default outline color depends on the PATTERN statement. If you do not specify a PATTERN statement, the default outline color is black for the Java or ActiveX devices. Otherwise, the default outline color is the foreground color (the first color in the colors list). If you specify the PATTERN statement or the V6COMP graphics option, the default is COUTLINE=SAME.

    Note: The outline color is the only distinction between empty patterns. Use of this option makes the patterns look the same when VALUE=EMPTY in PATTERN definitions.

    Featured in: Example 4 on page 910

    Not supported by: ActiveX (partial)

CTEXT= text-color

  • specifies a color for all text on the axes and legend, including axis labels, tick mark values, legend labels, and legend value descriptions.

    For the Java and ActiveX device drivers, the default text color is black. Otherwise, the default text color is determined in the following order:

    1. specified colors on assigned AXIS and LEGEND statements

    2. the CTEXT= option in a GOPTIONS statement

    3. the first color in the colors list.

  • For legend text, colors that you specify on an assigned LEGEND statement override CTEXT=. Thus, a LEGEND statement's VALUE= color is used for legend values, and its LABEL= color is used for legend labels.

    For axes text, colors that you explicitly specify for values and labels on an assigned AXIS statement override CTEXT=. Thus, an AXIS statement's VALUE= color is used for axis values, and its LABEL= color is used for axis labels. However, if the AXIS statement specifies only general axis colors with its COLOR= option, the CTEXT= color overrides that general specification and is used for axis labels and values; the COLOR= color is still used for all other axis colors, such as tick marks.

    If you use a BY statement in the procedure, the color of the BY variable labels is controlled by the CBY= option in the GOPTIONS statement.

    Featured in: Example 4 on page 910

CVREF= reference-line-color ( reference-line-color ) reference-line-color-list

CV= reference-line-color ( reference-line-color ) reference-line-color-list

  • specifies the color of reference lines drawn perpendicular to the vertical axis. Specifying a single color without parentheses applies that color to all reference lines drawn with the AUTOVREF and VREF= options. Note that the CAUTOVREF= option overrides CVREF= option for lines drawn with the AUTOVREF option. Specifying a single color in parentheses applies that color only to the first reference line. Specifying a color list applies colors sequentially to successive reference lines. The syntax of the color list is of the form ( color1 color2 colorN ) or ( color1 , color2 , colorN ). Default colors for reference lines are determined by the CAXIS= option or by the first color in the color list. To specify line types for these reference lines, use the LVREF= option. To specify labels for these reference lines, use the VAXIS= option.

    Not supported by: Java

DESCRIPTION= entry-description

DES= entry-description

  • specifies the description of the catalog entry for the chart. The maximum length for entry-description is 256 characters . The description does not appear on the chart. By default, the GCONTOUR procedure assigns a description of the form PLOT OF y*x=z , where y*x=z is the request specified in the PLOT statement.

GRID

  • draws reference lines at all major tick marks on both axes and outlines the axis area. This is the same as specifying both AUTOHREF and AUTOVREF.

    Not supported by: ActiveX

HAXIS=AXIS<1 99>

  • assigns axis characteristics from the corresponding axis definition to the horizontal (X) axis. If the AXIS statement specifies the REFLABEL= option, labels will be applied in sequence to all reference lines generated with the AUTOHREF and HREF= options.

    For Web output that is generated with a Java or ActiveX device driver, certain options of the AXIS statement are not supported. For details, see AXIS Statement on page 124.

    See also: AXIS Statement on page 124

    Featured in: Example 2 on page 906

    Not supported by: Java (partial), ActiveX (partial)

HMINOR= number-of-minor-ticks

HM= number-of-minor-ticks

  • specifies the number of minor tick marks to draw between each major tick mark on the horizontal (X) axis. The HMINOR= option overrides the MINOR= option in an AXIS definition assigned to the horizontal axis.

HREF= value-list

  • draws one or more reference lines perpendicular to the horizontal axis at points specified by value-list . See the LEVELS= option for a description of value-list . To specify colors for these reference lines, use the CHREF= option. To specify line types for these reference lines, use the LHREF= option. To specify labels for these reference lines, use the HAXIS= option.

    Not supported by: Java

HREVERSE

  • specifies that the order of the values on the horizontal (X) axis be reversed .

    Not supported by: Java

JOIN

  • combines adjacent grid cells with the same pattern to form a single pattern area. This option is ignored unless the PATTERN option is also used.

    Featured in: Example 4 on page 910

LAUTOHREF= reference-line-type

  • specifies a line type for reference lines drawn at major tick marks on the horizontal axis, as specified by the AUTOHREF option. The reference-line-type value can be a whole number from 1 to 46. A value of 1 specifies a solid line; values 2 through 46 specify dashed lines. The default value 1 draws a solid line. To specify colors for these reference lines, use the CAUTOHREF= option. To specify labels for these reference lines, use the HAXIS= option.

    Not supported by: Java

LAUTOVREF= reference-line-type

  • specifies a line type for reference lines drawn at major tick marks on the vertical axis, as specified by the AUTOVREF option. The reference-line-type value can be a whole number in the range of 1 to 46. A value of 1 specifies a solid line; values 2 through 46 specify dashed lines. The default value 1 draws a solid line. To specify colors for these reference lines, use the CAUTOVREF= option. To specify labels for these reference lines, use the VAXIS= option.

    Not supported by: Java

LEGEND=LEGEND<1 99>

  • assigns a legend definition that specifies the location, text, and appearance of axes on the plots. To suppress the legend, use the NOLEGEND option. The LEGEND= option is ignored if the specified LEGEND definition is not currently in effect.

    If you use the SHAPE= option in a LEGEND statement, the value LINE is valid. If you use the PATTERN option, SHAPE=BAR is also valid.

    In Web output that uses a Java or ActiveX device driver, the legend will always appear on the right side of the plot.

    See also: LEGEND Statement on page 151

    Featured in: Example 2 on page 906

    Not supported by: Java (partial), ActiveX (partial)

LEVELS= value-list

  • specifies values for the z variable for plot contour levels and therefore changes the number of contour levels. You can specify up to 100 values. This option is ignored if you use the AUTOLABEL option.

    By default, the GCONTOUR procedure plots seven contour levels for the z variable. These levels occur at every 15th percent of the range between the 5th and 95th percentiles.

    For numeric variables, value-list can be an explicit list of values, a starting and an ending value with an interval increment, or a combination of both forms:

    • n < n >

    • n TO n <BY increment >

    • n < n >TO n <BY increment > n < n >

  • If a numeric variable has an associated format, the specified values must be the unformatted values.

    By default, the GCONTOUR procedure selects colors and line types for the contour levels by rotating through the colors list for each line type (1 through 46) until all the levels have been represented. The level lines on the plot represent the intersection of a plane, parallel to the X/Y plane, and the surface that is formed by the values of the z variable. See Selecting Contour Levels on page 899 for more information.

    You can specify the colors and line types for contour levels. The way to do this depends on whether AUTOLABEL is used:

    • If AUTOLABEL is used, the SYMBOL Statement on page 183 controls colors and line types for contour levels.

    • If AUTOLABEL is not used, the CLEVELS= and LLEVELS= options control colors and line types for contour levels.

  • As an alternative to representing contour levels with contour lines, you can use the PATTERN option to fill each level with a solid pattern or with the colors and patterns specified in PATTERN statements.

    Featured in: Example 2 on page 906 and Example 3 on page 908

LHREF= reference-line-type ( reference-line-type ) reference-line-type-list

LH= reference-line-type ( reference-line-type ) reference-line-type-list

  • specifies line types for reference lines drawn perpendicular to the horizontal axis. The reference-line-type value can be a whole number from 1 to 46. A value of 1 specifies a solid line; values 2 through 46 specify dashed lines. Specifiying a single line type without parentheses applies that line type to all reference lines drawn with the AUTOHREF and HREF= options. Note that the CAUTOHREF= option overrides LHREF= reference-line-type for lines drawn with the AUTOHREF option. Specifying a single line type in parentheses applies that line type only to the first reference line drawn by the HREF= option. Specifying a line-type list applies line types in sequence to successive reference lines drawn with the HREF= option. The syntax of the line type list is of the form ( type1 type2 type3 ). The default value of 1 draws a solid line. To specify colors for these references lines, use the CHREF= option. To specify labels for these reference lines, use the HAXIS= option.

    Not supported by: Java (partial), ActiveX (partial)

LLEVELS= line-type-list

  • lists line type numbers for plot contour lines. Each line type represents one contour level, so the number of line types listed should correspond to the number of contour levels. Thus, for a contour plot that uses the default seven levels, specify seven line types.

    If fewer line types are specified than the number of levels in the plot, the procedure provides default line types. With the default, contour levels rotate through line types 1 through 46, displaying each line type in all of the colors in the colors list before moving to the next line type. Line type 1 is a solid line and the others are dashed line. See Specifying Line Types on page 207 for available line types.

    For colors and lines specified with both the CLEVELS= and LLEVELS= options, the first contour level is displayed in the first color in the CLEVELS= color list and in the first line type specified with the LLEVELS= option. The second level is displayed in the second color and the second line type, and so on.

    This option is ignored if AUTOLABEL is used.

    Featured in: Example 3 on page 908

    Not supported by: Java

LVREF= reference-line-type ( reference-line-type ) reference-line-type-list

LV = reference-line-type ( reference-line-type ) reference-line-type-list

  • specifies line types for reference lines drawn perpendicular to the vertical axis. The reference-line-type value can be a whole number from 1 to 46. A value of 1 specifies a solid line; values 2 through 46 specify dashed lines. Specifying a single line type without parentheses applies that line type to all reference lines drawn with the AUTOVREF and VREF= options. Note that the CAUTOVREF= option overrides LVREF= reference-line-type for lines drawn with the AUTOVREF option. Specifying a single line type in parentheses applies that line type only to the first reference line drawn by the VREF= option. Specifying a line-type list applies line types in sequence to successive reference lines drawn with the VREF= option. The syntax of the line type list is of the form ( type1 type2 type3 ). The default value 1 draws a solid line. To specify colors for these references lines, use the CVREF= option. To specify labels for these reference lines, use the VAXIS= option.

    Not supported by: Java (partial), ActiveX (partial)

NAME= entry-name

  • specifies the name of the catalog entry for the graph. The maximum length for entry-name is 8 characters. The default name is GCONTOUR. If you specify DEVICE=ACTIXIMG or DEVICE=JAVAIMG, then the name that you specify will be used for the client image output even in the file exists. For all other devices, if the name duplicates an existing entry name, SAS/GRAPH adds a number to the duplicate name to create a unique entry, for example, GCONTOU1.

NLEVELS= number-of-levels

  • specifies the number of contour levels to plot. Values can be integers from 1 to 100. The default is NLEVELS=7. The contour levels are computed as follows , where L represents an array of levels:

    • If the value of NLEVELS= is less than 7, then

       D = (Zmax - Zmin) / NLEVELS  d = 0.5 * D  L[0]  = Zmin + d, L[i]  = L[i-1]  + D 

      In this case, each level is the midpoint of a number of ranges equal to the value of the NLEVELS= option. These ranges exactly cover the range of the z variable.

    • If the value of NLEVELS= is greater than or equal to 7, then

       e = 0.05 * (100 - NLEVELS) / 93  d = (Zmax - Zmin) * e  D = ((Zmax - Zmin - 2*d) / (NLEVELS - 1)  L[0] = Zmin + d, L[i] = L[i-1] + D 

      In this case, the first and last midpoints are set closer to the minimum and maximum values of the z variable as the values of NLEVELS= gets closer to 100, and the remaining midpoints are equally spaced between them.

NOAXIS

NOAXES

  • specifies that a plot have no axes, axis values, or axis labels. The frame is displayed around the plot unless you use the NOFRAME option.

NOFRAME

  • suppresses the frame that is drawn by default around the plot area.

NOLEGEND

  • suppresses the plot legend that describes contour levels and their line types or fill patterns and colors.

PATTERN

  • specifies the fill pattern and pattern colors for contour areas. The plot contour levels are represented by rectangles filled with patterns. The pattern for each rectangle is determined by calculating the mean of the values of the z variable for the four corners of the rectangle and assigning the pattern for the level closest to the mean.

    By default, the procedure uses a solid pattern for the levels and rotates the pattern through the colors list. If the V6COMP option is in effect for the GOPTIONS statement, cross-hatch patterns are used instead of solid patterns. To explicitly define patterns, use PATTERN definitions for map/plot patterns.

    For information on PATTERN statement that are enabled for Web output, see PATTERN Statement on page 169.

    See also: Selecting Contour Levels on page 899

    Featured in: Example 4 on page 910

    Featured in: Example 3 on page 908

    Not supported by: Java (partial), ActiveX (partial)

VAXIS=AXIS<1 99>

  • assigns axis characteristics from the corresponding axis definition to the vertical (Y) axis. If the AXIS statement specifies the REFLABEL= option, labels will be applied in sequence to all reference lines generated with the AUTOVREF and VREF= options.

    For Web output that is generated with a Java or ActiveX device driver, certain options of the AXIS statement are not supported. For details, see AXIS Statement on page 124.

    See also: AXIS Statement on page 124

    Featured in: Example 2 on page 906

    Not supported by: Java (partial), ActiveX (partial)

VMINOR= number-of-minor-ticks

VM= number-of-minor-ticks

  • specifies the number of minor tick marks located between each major tick mark on the vertical (Y) axis. No values are displayed for minor tick marks. The VMINOR= option overrides the MINOR= option in an AXIS definition that is assigned to the vertical axis.

VREF= value-list

  • draws one or more reference lines perpendicular to the vertical axis at points specified by value-list . See the LEVELS= option for a description of value-list . To specify colors for these reference lines, use the CVREF= option. To specify line types for these reference lines, use the LVREF= option. To specify labels for these reference lines, use the VAXIS= option.

    Not supported by: Java

VREVERSE

  • specifies that the order of the values on the vertical axis be reversed.

    Not supported by: Java

XTICKNUM= number-of-ticks

YTICKNUM= number-of-ticks

  • specify the number of major tick marks located on a plot's X or Y axis, respectively. The value of number-of-ticks must be 2 or greater. The defaults are XTICKNUM=5 and YTICKNUM=5.

    The MAJOR= or ORDER= option in an AXIS definition that is assigned to the X axis overrides the XTICKNUM= option. The MAJOR= or ORDER= option in an AXIS definition that is assigned to the Y axis overrides the YTICKNUM= option.

Autolabel Suboptions

The AUTOLABEL= option accepts the following autolabel suboptions.

CHECK= checking-factor NONE

  • specifies a collision checking factor that controls collisions between contour label text and other contour lines or other labels. Values can be integers from 0 to 100, inclusive, where 0 provides minimal collision checking and 100 provides maximal collision checking. Fractional values are permitted. The default is CHECK=75.

    CHECK=NONE suppresses contour label collision checking and may lessen the time needed to compute the contour graph.

MAXHIDE= amount < units >

  • specifies the maximum amount of contour line that can be hidden by contour labels. The value of amount must be greater than zero.

    Valid units are CELLS (horizontal character cell positions), CM (centimeters), IN (inches), or PCT (percentage of the width of the graphics output area). The default is MAXHIDE=100PCT. If you omit units , a unit specification is searched for in this order:

    1. the GUNIT= option in a GOPTIONS statement

    2. the default unit, CELLS.

  • If you specify units of PCT or CELLS, the MAXHIDE= suboption calculates the amount of contour line that can be hidden based on the width of the graphics output area. For example, if you specify MAXHIDE=50PCT and if the graphics output area is 9 inches wide, the maximum amount of the contour line that can be hidden by labels is 4.5 inches.

    This option maintains data integrity. It provides a check for overly small increments in the STEP= option in the SYMBOL statement. Additionally, it can prevent small contours from being significantly hidden even when the value of STEP= is sufficiently large.

REVEAL

  • specifies that the contour lines are visible through the label text as dashed lines. Line style 33 is used. This option provides a simple way to see all portions of labeled contours and can be used to inspect the label positions with respect to the contour lines. It is primarily used for debugging. Occasionally, single-character contour labels can be placed off center from the clipped portion of the contour line when the contour line is irregular or jagged.

TOLANGLE= angle

  • specifies the maximum angle (the tolerance angle) between any two adjacent characters of a contour label. The value of angle must be between 1 and 85 degrees. The default is TOLANGLE=30. To force contour labels to fall on very smooth sections, specify a small tolerance angle.

Selecting Contour Levels

You can use the LEVELS= option to select the contour levels for your plot. You use LEVELS= values differently, depending on whether you specify the PATTERN option in the PLOT statement.

When you do not use the PATTERN option, the levels represent the intersection of a plane (parallel to the X/Yplane at the value of the z variable) and the surface formed by the data. That is, if you use the data to create a surface plot with the G3D procedure, the contour lines in a GCONTOUR procedure plot represent the intersection of the plane and the surface.

For example, suppose that you use the G3D procedure, and your data produces a surface plot like the one shown in Figure 30.2 on page 899. The same data used with the following PLOT statement in the GCONTOUR procedure produces a similar contour plot:

 plot y*x=z / levels=-7.5 to 7.5 by 2.5; 

The contour lines in Figure 30.3 on page 900 represent the intersection of the surface in Figure 30.2 on page 899 with planes parallel to the plane formed by the variables x and y and located at z values of “7.5, “5.0, “2.5, and so on.

click to expand
Figure 30.2: Surface Plot
click to expand
Figure 30.3: Line Contour Levels

When you use the PATTERN option, contour levels are represented by rectangles filled with patterns. The rectangles are formed by points in the x-y grid. The contour pattern of a rectangle, or grid cell, is determined by the mean or average value of the z variable for the four corners of the rectangle. The grid cell is assigned the pattern for the level closest to the calculated mean. For example, if you have specified contour levels of 0, 5, and 10, and the plot contains a grid cell with a mean of 100, it is assigned the pattern for the nearest level: 10. A grid cell with a mean of 7.6 will also be assigned the pattern for the 10 level.

Figure 30.4 on page 900 shows a contour plot with the PATTERN option that uses the same data and contour levels as Figure 30.3 on page 900. The pattern for the rectangle is assigned depending on the mean of the grid values at the four corners. As a result, two contour plots using the same contour levels can present your data differently if one plot uses a pattern and the other does not. The contour pattern boundaries do not correspond to the contour lines shown in Figure 30.3 on page 900.

click to expand
Figure 30.4: Pattern Contour Levels

Specifying Axis Order

You can use AXIS statements to modify the text and appearance of plot axes, and then you can assign the axes to the contour plot with the PLOT statement's HAXIS= and VAXIS= options. If the AXIS statement uses an ORDER= option, there are special considerations for using that AXIS definition with the GCONTOUR procedure.

A list of variable values that are specified with the AXIS statement's ORDER= option must contain numbers listed in ascending or descending order; these numbers are treated as a continuous data range for an axis. Thus, for a contour line or pattern to span the entire specified range, it is not necessary for the maximum and minimum values of the list to match exactly with the maximum and minimum data values of the corresponding x or y variable. For example, suppose that you assign this AXIS definition to the horizontal ( x ) axis:

 axis1 order=-2.5 to 2.5 by .5 

Suppose also that the horizontal axis variable has these values: “5, “4, “3, “2, “1, 0, 1, 2, 3, 4, 5. Depending on the data, contours could extend through the full range of the ORDER= list rather than from “2 to 2, which are the actual values of the variable assigned to the horizontal ( x ) axis. In this case, values are interpolated for the x variable at any point where the y variable intersects the minimum axis value ( “2.5) or the maximum axis value (2.5). Data values that are outside of the axis range (in this case, “5, “4, “3, 3, 4, and 5) are clipped from the plot.

When ORDER= lists cause data clipping, internal plotting grids are modified according to these rules:

  • If an ORDER= list causes data clipping on a single axis, linear interpolation generates the z values of the starting and/or ending column of the plotting grid. For example, in the previous example, the value of z is interpolated for “2.5 and 2.5 on the horizontal ( x ) axis.

  • If ORDER= lists cause data clipping on both axes, the response variable values of the new corners are derived by fitting the new x , y location on a plane formed by three of the original four points of the corresponding grid square.

In addition, if you assign the following AXIS definition to a plot of the same data, the contour levels on the plot will not extend beyond the range of the data:

 axis1 order=-10 to 10 by 1; 

To see the effects of the ORDER= option:

  • Figure 30.5 on page 902 shows the effects when the range of ORDER= values matches the range of values for the variables assigned to the horizontal ( x ) and vertical ( y ) axes.

    click to expand
    Figure 30.5: AXIS Statement s ORDER= Option, where Option Values Match Variable Values

  • Figure 30.6 on page 902 shows the effects when the range of ORDER= values is smaller than the range of data values.

    click to expand
    Figure 30.6: ORDER= Option, where the Option Range is Smaller than the Variable Range

  • Figure 30.7 on page 903 shows the effects when the range of ORDER= values is larger than the range of data values.

    click to expand
    Figure 30.7: ORDER= Option, where the Option Range is Larger than Variable Range

Modifying Contour Lines and Labels with the SYMBOL Statement

When you use the AUTOLABEL option, the LLEVELS= and CLEVELS= options are ignored, and contour-line and label attributes are controlled by the SYMBOL statement. Defaults are used if not enough SYMBOL statements are specified to match the number of contour levels.

If a SYMBOL statement does not include a color option, that statement may be applied to more than one contour level. In this case, the SYMBOL statement is used once with every color in the colors list and generates more than one SYMBOL definition. See SYMBOL Statement on page 183 for details.

Table 30.1 on page 903 describes how SYMBOL statement options affect contour plot lines and labels.

Table 30.1: The Effect of SYMBOL Statement Options on Contour Lines and Labels

SYMBOL Statement Option

Contour Line or Label Element Affected

LINE= line-type

Contour line style

WIDTH= n

Contour line thickness

CI= line-color or COLOR= color

Contour line color

FONT= font

Contour label font

HEIGHT= height

Contour label height

CV= color or COLOR= color

Contour label color

STEP= distance < units >

Minimum distance between labels on the same contour line

VALUE= text

Contour label text

VALUE=NONE

Suppresses the contour label text

The SYMBOL statement option INTERPOL= is not supported by the GCONTOUR procedure.

The STEP= option specifies the minimum distance between contour labels. The lower the value, the more labels the procedure uses. A STEP= value of less than 10 percent is ignored by the GCONTOUR procedure and a value of 10 percent is substituted.

For more information, see SYMBOL Statement on page 183.

Specifying Text for Contour Labels

To override the default labels that are displayed by the AUTOLABEL option, you can specify label text for one or more contour lines. To do so, use both the FONT= and VALUE= options on the SYMBOL statement that is assigned to the contour level. Default labels are used for contour levels that you do not label.

For example, this SYMBOL1 statement displays the text string Highest in the Swiss font on the contour line that it modifies:

 symbol1 font=swiss value='Highest'; 

You must specify both FONT= and VALUE= or the text is not used. For an example, see Example 2 on page 906.




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