Previous Page | Next Page

SAS/GRAPH Statements

SYMBOL Statement



Defines the characteristics of symbols that display the data plotted by a PLOT statement used by PROC GBARLINE, PROC GCONTOUR, and PROC GPLOT.
Used by: GBARLINE, GCONTOUR, GPLOT procedures
Type Global

Syntax
Description
Options
Using the SYMBOL Statement
Altering or Canceling SYMBOL Statements
Controlling Consecutive SYMBOL Statements
Setting Definitions for PROC GPLOT and PROC GBARLINE
Specifying Plot Symbols
Specifying a Default Interpolation Method
Sorting Data with Spline Interpolation
Using Color
Specifying Colors with SYMBOL Statements
Specifying Color with CSYMBOL=
Specifying Line Types
Using Generated Symbol Sequences
Default Symbol Sequences
Symbol Sequences Generated from SYMBOL Statements

Syntax

SYMBOL<1...255> <COLOR=symbol-color|_style_>
<MODE=EXCLUDE | INCLUDE> <REPEAT=number-of-times>
<STEP=distance<units>> <appearance-option(s)>
<interpolation-option> <SINGULAR=n>;

appearance-options can be one or more of these:

BWIDTH=box-width

CI=line-color|_style_

CO=color

CV=value-color|_style_

FONT=font

HEIGHT=symbol-height<units>

LINE=line-type

POINTLABEL<=(label-description(s)) | NONE>

VALUE=special-symbol | text-string | NONE

WIDTH=thickness-factor

interpolation-option can be one of these:


Description

SYMBOL statements create SYMBOL definitions, which are used by the GPLOT, GBARLINE and GCONTOUR procedures.

For the GPLOT and GBARLINE procedure, SYMBOL definitions control the following:

For the GCONTOUR procedure, SYMBOL definitions control the following:

If you create SYMBOL definitions, they are automatically applied to a graph by the procedure. If you do not create SYMBOL definitions, these procedures generate default definitions and apply them as needed to your plots.


Options

When the syntax of an option includes units, use one of these:

CELLS

character cells

CM

centimeters

IN

inches

PCT

percentage of the graphics output area

PT

points.

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.

BWIDTH=box-width

specifies the width of the box generated by either the INTERPOL=BOX or INTERPOL=HILOB option. Box-width can be any number greater than 0. By default, the value of box-width is the same as the value of the WIDTH= option, whose default value is 1. Therefore, if you specify a WIDTH= value for and omit the BWIDTH= option, the width of the box changes accordingly.

Featured in: Example 4. Creating and Modifying Box Plots.
CI=line-color|_style_

specifies a color for an interpolation line (GPLOT and GBARLINE) or a contour line (GCONTOUR). The _STYLE_ value specifies the appropriate color based on the current style. If you omit the CI= option but specify the CV= option, the CI= option assumes the value of the CV= option. In this case, the CI= and CV= options specify the same color, which is the same as specifying the COLOR= option alone.

If you omit the CI= option, the color specification is searched for in this order:

  1. the COLOR= option

  2. the CV= option

  3. the CSYMBOL= option in a GOPTIONS statement

  4. each color in the color list sequentially before the next SYMBOL definition is used.

See also: Using Color
Featured in: Example 1. Ordering Axis Tick Marks with SAS Date Values
CO=color

specifies a color for the following:

  • outlines of filled areas generated by the INTERPOL=map/plot-pattern option

  • confidence limit lines generated by the INTERPOL=R series option

  • staffs, boxes, and bars generated by the high-low interpolation methods: INTERPOL=HILO, INTERPOL=BOX, and INTERPOL=STD

If you omit the CO= option, the search order for a color specification depends on the interpolation method being used.

See also: Using Color
Featured in: Example 5. Filling the Area between Plot Lines and Example 4. Creating and Modifying Box Plots
COLOR=symbol-color | _style_

specifies a color for the entire definition, unless it is followed by a more explicit specification. For the GPLOT and GBARLINE procedures, this includes plot symbols, the plot line, confidence limit lines, and outlines. For the GCONTOUR procedure, this includes contour lines and labels. The _STYLE_ value specifies the appropriate color from the current style.

Using the COLOR= option is exactly the same as specifying the same color for both the CI= and CV= options.

If COLOR= precedes the CI= or CV= option in the same statement, the CI= or CV= option is used instead.

If you do not use the COLOR=, CI=, CV=, or CO= option, the color specification is searched for in this order:

  1. the CSYMBOL= option in a GOPTIONS statement

  2. each color in the color list sequentially before the next SYMBOL definition is used.

If you do not use a SYMBOL statement to specify a color for each symbol, but you do specify a color list in a GOPTIONS statement, then Java and ActiveX assign colors to symbols differently than other devices. To ensure consistency on all devices, you should specify the desired color of each symbol. If you do not specify a symbol color, SAS/GRAPH uses the first default color and the first symbol. It uses each color in the list of default colors until the list is exhausted. SAS/GRAPH then selects the next symbol and begins again with the first default color. It rotates the new symbol through the list of default colors before selecting another symbol. It continues selecting new symbols and colors until no more symbols are needed.

Note:   Neither the Java applet nor the ActiveX control supports using COLOR= with PROC GCONTOUR.  [cautionend]

Style Reference: Color attribute of the GraphLabelText style element.
Alias: C=symbol-color
See also: Using Color
Restriction: Partially supported by Java and ActiveX
CV=value-color|_style_

specifies a color for the following:

  • plot symbols in the GPLOT procedure

  • the filled areas generated by the INTERPOL=map/plot-pattern option

  • contour labels in the GCONTOUR procedure

The _STYLE_ value specifies the appropriate color based on the current style. If you omit the CV= option but specify the CI=, the CV= option assumes the value of the CI= option. In this case, the CV= and CI= options specify the same color, which is the same as specifying the COLOR= option alone.

If you omit the CV= option, the color specification is searched for in this order:

  1. the COLOR= option

  2. the CI= option

  3. the CSYMBOL= option in a GOPTIONS statement

  4. each color in the color list sequentially before the next SYMBOL definition is used.

Note:   Neither the Java applet nor the ActiveX control supports using the CV= option with PROC GCONTOUR.  [cautionend]

See also: Using Color
Featured in: Example 1. Ordering Axis Tick Marks with SAS Date Values, Example 5. Filling the Area between Plot Lines, and Example 4. Creating and Modifying Box Plots
Restriction: Partially supported by Java and ActiveX
FONT="font"

specifies the font for the plot symbol (GPLOT, GBARLINE) or contour labels (GCONTOUR) specified by the VALUE= option. The font specification must be enclosed in quotes and can include the /bold and /italic font modifiers.

By default, the symbol specified by the VALUE= option is taken from the special symbol table shown in Special Symbols for Plotting Data Points. To use symbols from the special symbol table, you must omit the FONT= option.

To use a symbol that is not in that special symbol table, specify the font containing the symbol and the character code or hexadecimal code of the symbol that you want to use. You can also specify text instead of special symbols. For example:

symbol font="Albany AMT" value="80"x;   /* hexadecimal code for the Euro symbol */
symbol font="Monotype Sorts" value="s";   /* character code for a filled triangle */
symbol font="Cumberland AMT/bo" value="F";   /* prints the letter F in bold */

To cancel a font specification and return to the default special symbol table, enter a null font specification:

symbol font= value=dot;
Alias: F=font
See also: the VALUE= option, Specifying Plot Symbols, and Specifying Special Characters Using Character and Hexadecimal Codes.
Featured in: Labeling Contour Lines, Modifying the Horizontal Axis, Modifying the Legend
Restriction: Not supported by Java and ActiveX
HEIGHT=symbol-height<units>

specifies the height in number of units of plot symbols (GPLOT, GBARLINE) or contour labels (GCONTOUR).

Note:   The HEIGHT= option affects only the height of the symbols and labels on the plot; it does not affect the height of any symbols that might appear in a legend.

The HEIGHT option overrides the MarkerSize attribute in graph styles. For more information on graph styles, see the Style Statement.  [cautionend]

Note:   With the Java device driver, the minimum height is two pixels; with ActiveX a symbol can be so small as to be invisible.

Neither the Java applet nor the ActiveX control supports HEIGHT= with PROC GCONTOUR.  [cautionend]

Alias: H=symbol-height<units>
See also: the option SHAPE= in the LEGEND statement
Featured in: Example 4. Creating and Modifying Box Plotsand Example 3. Rotating Plot Symbols Through the Color List
Restriction: Partially supported by Java and ActiveX
INTERPOL=BOX<option(s)><00...25>

produces box and whisker plots. The bottom and top edges of the box are located at the sample 25th and 75th percentiles. The center horizontal line is drawn at the 50th percentile (median). By default, INTERPOL=BOX. In this case the vertical lines, or whiskers, are drawn from the box to the most extreme point less than or equal to 1.5 interquartile ranges. (An interquartile range is the distance between the 25th and the 75th sample percentiles.) Any value more extreme than this is marked with a plot symbol.

Values for option(s) are one or more of these:

F

fills the box with the color specified by CV= and outlines the box with the color specified by CO=

J

joins the median points of the boxes with a line

T

draws tops and bottoms on the whiskers.

In addition, you can specify a percentile to control the length of the whiskers within the range 00 through 25. These are examples of percentile specifications and their effect:

00

high/low extremes. INTERPOL=BOX00 is not the same as the default, INTERPOL=BOX.

01

1st percentile low, 99th high

05

5th percentile low, 95th high

10

10th percentile low, 90th high

25

25th percentile low, 75th high; since the box extends from the 25th to the 75th percentile, no whiskers are produced.

Box Plot shows the type of plot INTERPOL=BOX produces.

Box Plot

[Box Plot]

Note:   If you use the HAXIS= or VAXIS= options in the PLOT statement or the ORDER= option in an AXIS definition to restrict the range of axis values, by default any observations that fall outside the axis range are excluded from the interpolation calculation. See the MODE= option  [cautionend]

You cannot use the GPLOT procedure PLOT statement option AREAS= with INTERPOL=BOX.

To increase the thickness of all box plot lines, including the box, whiskers, join line, and top and bottom ticks, use the WIDTH= option.

To increase the width of the box itself, use the BWIDTH= option. By default the value of the BWIDTH= option is the same as the value of the WIDTH= option. Therefore, if you specify a value for the WIDTH= option and omit BWIDTH=, the width of the box changes.

For a scatter effect with the box, use a multiple plot request, as in this example:

symbol1 i=none v=star color=green;
symbol2 i=box v=none color=blue;
proc gplot data=test;
   plot (y y)*x / overlay;

Note:   When using DEVICE=JAVA and DEVICE=JAVAIMG with overlaid plots, different interpolations are supported per overlay unless any of the interpolations is BOX, HILO or STD. When any of these interpolations are encountered, the first interpolation specified becomes the only interpolation that is used for all overlays. All other interpolations are ignored.  [cautionend]

Alias: I=BOX<option(s)><00...25>
Featured in: Example 4. Creating and Modifying Box Plots
INTERPOL=HILO<C><option>

specifies that a solid vertical line connect the minimum and maximum Y values for each X value. The data should have at least two values of Y for every value of X; otherwise, the single value is displayed without the vertical line.

By default, for each X value, the mean Y value is marked with a tick. This is shown in High-Low Plot.

To specify high, low, close stock market data, include this option:

C

draws tick marks at the close value instead of at the mean value. Specifying C assumes that there are three values of Y (HIGH, LOW, and CLOSE) for every value of X. If more or fewer than three Y values are specified, the mean is ticked. The Y values can be in any order in the input data set.

In addition, you can specify one of these values for option:

B

connects the minimum and maximum Y values with bars instead of lines. Use the BWIDTH= option to increase the width of the bars.

J

joins the mean values or the close values (if HILOC is specified) with a line. This point is not marked with a tick mark. You cannot use the PLOT statement option AREAS= with INTERPOL=HILOJ.

T

adds tops and bottoms to each line.

BJ

connects maximum and minimum values with a bar and joins the mean or close values.

TJ

adds tops and bottoms to the lines and joins the mean or close values.

High-Low Plot shows the type of plot INTERPOL=HILO produces. Plot symbols in the form of dots have been added to this figure.

High-Low Plot

[High-Low Plot]

To increase the thickness of all lines generated by the INTERPOL=HILO option, use the WIDTH= option.

Note:   If you use the HAXIS= or VAXIS= options in the PLOT statement or the ORDER= option in an AXIS definition to restrict the range of axis values, by default any observations that fall outside the axis range are excluded from the interpolation calculation. See the option MODE= .  [cautionend]

When using DEVICE=JAVA and DEVICE=JAVAIMG with overlaid plots, different interpolations are supported per overlay unless any of the interpolations is BOX, HILO or STD. When any of these interpolations are encountered, the first interpolation specified becomes the only interpolation that is used for all overlays. All other interpolations are ignored.

Alias: I=HILO<C><option>
Featured in: Example 1. Ordering Axis Tick Marks with SAS Date Values
Restriction: Partially supported by Java
INTERPOL=JOIN

connects data points with straight lines. Points are connected in the order they occur in the input data set. Therefore, the data should be sorted by the independent (horizontal axis) variable.

If the data contain missing values, the observations are omitted. However, the plot line is not broken at missing values unless the SKIPMISS option is used.

Alias: I=JOIN
See also: the SKIPMISS option and Missing Values
INTERPOL=L<degree><P><S>

specifies a Lagrange interpolation to smooth the plot line. Specify one of these values for degree:

1 | 3 | 5

specifies the degree of the Lagrange interpolation polynomial. By default, degree is 1.

In addition, you can specify one or both of these:

P

specifies a parametric interpolation

S

sorts a data set by the independent variable before plotting its data.

The Lagrange methods are useful chiefly when data consist of tabulated, precise values. A polynomial of the specified degree (1, 3, or 5) is fitted through the nearest 2, 4, or 6 points. In general, the first derivative is not continuous. If the values of the horizontal variable are not strictly increasing, the corresponding parametric method (L1P, L3P, or L5P) is used.

Specifying INTERPOL=L1P, INTERPOL=L3P, or INTERPOL=L5P results in a parametric Lagrange interpolation of degree 1, 3, or 5, respectively. Both the horizontal and vertical variables are processed with the Lagrange method and a parametric interpolation of degree 1, 3, or 5, using the distance between points as a parameter.

INTERPOL=map/plot-pattern
I=map/plot-pattern

specifies that a pattern fill the polygon that has been defined by the data points. Values for map/plot-pattern are as follows:

MEMPTY
ME

an empty pattern. EMPTY and E are valid aliases.

The Java applet does not support this option.

MSOLID
MS

a solid pattern. SOLID and S are valid aliases

Mdensity<style<angle>>

a shaded pattern. (The Java applet does not support this option.)

Density specifies the density of the pattern's shading:

1...5

1 produces the lightest shading and 5 produces the heaviest.

Style specifies the direction of pattern lines:

N

parallel lines (the default)

X

crosshatched lines.

Angle specifies the starting angle for parallel or crosshatched lines:

0...360

the degree at which the parallel lines are drawn. By default, angle is 0 (lines are parallel to the horizontal axis).

The INTERPOL=map/plot-pattern option only works if the data are structured so that the data points and, consequently, the plot lines form an enclosed area. The plot lines should not cross each other.

Alias: I=L<degree><P><S>
See also: the PATTERN Statement
Featured in: Example 5. Filling the Area between Plot Lines
Restriction: Partially supported by Java
INTERPOL=NEEDLE

draws a vertical line from each data point to a horizontal line at the 0 value on the vertical axis or the minimum value on the vertical axis. The horizontal line is drawn automatically.

Needle Plot shows the type of plot INTERPOL=NEEDLE produces. Plot symbols are not displayed in this figure.

Needle Plot

[Needle Plot]

You cannot use the PLOT statement option AREAS= with INTERPOL=NEEDLE.

Alias: I=NEEDLE
INTERPOL=NONE
I=NONE

suppresses any interpolation and, if the VALUE= option is not specified, also suppresses plot points. If no interpolation method is specified in a SYMBOL statement and if the graphics option INTERPOL= is not used, INTERPOL=NONE is the default.

You cannot use the PLOT statement option AREAS= with INTERPOL=NONE.

INTERPOL=R<type><0><CLM | CLI<50...99>>

specifies that a plot is a regression analysis. By default, regression lines are not forced through plot origins and confidence limits are not displayed.

Type specifies the type of regression. Specify one of these values for type:

L

requests linear regression representing the regression equation

Y= [beta] 0 + [beta] 1 X

Q

requests quadratic regression representing the regression equation

Y= [beta] 0 + [beta] 1 X + [beta] 2 X2

C

requests cubic regression representing the regression equation

Y= [beta] 0 + [beta] 1 X+ [beta] 2 X 2 + [beta] 3 X3

Note:   When least-square solutions for the parameters are not unique, the SAS/GRAPH uses a quadratic equation by default for the interpolation whereas the Java and ActiveX device drivers might pick a cubic solution to use.  [cautionend]

By default, type is L. The regression line is drawn in the line type specified in the LINE= option. By default, the type of the regression line is 1.

Note:   You must specify type if you use either 0, or CLI, or CLM.  [cautionend]

To force the regression line through a (0,0) origin, specify:

0

eliminates the [beta] 0 parameter, or intercept, from the regression equation. If the origin is at (0,0), also forces the regression line through the origin. For example, if you specify 0 for a linear regression, the plot line represents the equation

Y= [beta]1 X

Note:   To force the regression line through the origin (0,0) when the data ranges do not place the origin at (0,0), use the GPLOT procedure options HZERO and VZERO (ignored if the data contain negative values), or use the HAXIS= and VAXIS= options to specify axes ranges from 0 to maximum data value. If the data ranges contain negative values and the HAXIS= and VAXIS= options specify ranges starting at 0, only values within the displayed range are used in the interpolation calculations.  [cautionend]

To display confidence limits, specify one of these:

CLM

displays confidence limits for mean predicted values

CLI

displays confidence limits for individual predicted values.

You can specify confidence levels from 50% to 99%. By default, the confidence level is 95%. Include a confidence level specification only if you use CLM or CLI.

The line type used for the confidence limit lines is determined by adding 1 to the values of LINE=. By default, the line type of confidence limit lines is 2.

Plot of Regression Analysis and Confidence Limits shows the type of plot INTERPOL=RCCLM95 produces (cubic regression analysis with 95% confidence limits).

Plot of Regression Analysis and Confidence Limits

[Plot of Regression Analysis and Confidence Limits]

Alias: I=R<type><0><CLM | CLI<50...99>>
Featured in: Plotting Two Variables
Restriction: Partially supported by Java
INTERPOL=SM<nn><P><S>

specifies that a smooth line is fit to data using a spline routine. INTERPOL=SM is a method for smoothing noisy data. The points on the plot do not necessarily fall on the line.

The relative importance of plot values versus smoothness is controlled by nn. Values for nn are as follows:

0...99

produces a cubic spline that minimizes a linear combination of the sum of squares of the residuals of fit and the integral of the square of the second derivative (Reinsch 1967)(footnote 1). The greater the nn value, the smoother the fitted curve. By default, the value of nn is 0.

In addition, specify one or both of these:

P

specifies a parametric cubic spline

S

sorts data by the independent variable before plotting.

Restriction: Not supported by Java
INTERPOL=SPLINE<P><S>

specifies that the interpolation for the plot line use a spline routine. INTERPOL=SPLINE produces the smoothest line and is the most efficient of the nontrivial spline interpolation methods.

Spline interpolation smoothes a plot line using a cubic spline method with continuous second derivatives (Pizer 1975)(footnote 2)This method uses a piecewise third-degree polynomial for each set of two adjacent points. The polynomial passes through the plotted points and matches the first and second derivatives of neighboring segments at the points.

Specify one or both of these:

P

specifies a parametric spline interpolation method. This interpolation uses a parametric spline method with continuous second derivatives. Using the method described earlier for the spline interpolation, a parametric spline is fitted to both the horizontal and vertical values. The parameter used is the distance between points

[equation]

If two points are so close together that the computations overflow, the second point is not used.

S

sorts a data set by the independent variable before plotting its data.

Note:   When points on the graph are out of range of the axis values, the curve is clipped. If an end point is out of range, no curve is drawn. Out-of-range conditions can be caused by restricting the range of axis values with the HAXIS= or VAXIS= option in the PLOT statement or the ORDER= option in an AXIS definition.

Note:   When points on the graph are close together and a spline interpolation is used, the Java applet is unable to draw some line types correctly.  [cautionend]

  [cautionend]
Alias: I=SPLINE<P><S>
INTERPOL=STD<1 | 2 | 3><variance><option(s)>

specifies that a solid line connect the mean Y value with ± 1, 2, or 3 standard deviations for each X.

Note:   By default, two standard deviations are used.  [cautionend]

The sample variance is computed about each mean, and from it, the standard deviation sy is computed. Variance can be one or both of these:

M

computes [equation],

P

computes sample variances using a pooled estimate, as in a one-way ANOVA model.

In addition, specify one of these values for option(s):

B

connects the minimum and maximum Y values with bars instead of lines.

J

connects the means from bar to bar with a line.

T

adds tops and bottoms to each line.

BJ

connects maximum and minimum values with a bar and joins the mean values.

TJ

adds tops and bottoms to the lines and joins the mean values.

Plot of Standard Deviations shows the type of plot INTERPOL=STD produces. A horizontal tick is drawn at the mean.Plot symbols in the form of dots have been added to this figure.

Plot of Standard Deviations

[Plot of Standard Deviations]

Note:   By default, the vertical axis ranges from the minimum to the maximum Y value in the data. If the requested number of standard deviations from the mean covers a range of values that exceeds the maximum or is less than the minimum, the STD lines are cut off at the minimum and maximum Y values. When this cutoff occurs, rescale the axis using VAXIS= in the PLOT statement or ORDER= in an AXIS definition so that the STD lines are shown.  [cautionend]

If you restrict the range of axis values by using the HAXIS= or VAXIS= option in a PLOT statement or the ORDER= option in an AXIS definition, by default any observations that fall outside the axis range are excluded from the interpolation calculation. See the MODE= option option.

To increase the thickness of all lines generated by the INTERPOL=STD option, use the WIDTH= option.

You cannot use the PLOT statement option AREAS= with INTERPOL=STD.

When using DEVICE=JAVA and DEVICE=JAVAIMG with overlaid plots, different interpolations are supported per overlay unless any of the interpolations is BOX, HILO or STD. When any of these interpolations are encountered, the first interpolation specified becomes the only interpolation that is used for all overlays. All other interpolations are ignored.

Alias: I=STD<1 | 2 | 3><variance><option(s)>
Restriction: Partially supported by Java
INTERPOL=STEP<placement><J><S>

specifies that the data are plotted with a step function. By default, the data point is on the left of the step, the steps are not joined with a vertical line, and the data are not sorted before processing.

Specify one of these values for placement:

L

displays the data point on the left of the step.

R

displays the data point on the right of the step.

C

displays the data point in the center of the step.

Note:   When a step is retraced in order to locate its center point, the GIF, JPEG, PNG, ACTXIMG, Java, and JAVAIMG devices treat this as effectively not drawing that part of the step at all. ActiveX, however, draws each part of the step--resulting in a somewhat different graph.  [cautionend]

In addition, specify one or both of these:

J

produces steps joined with a vertical line.

S

sorts unordered data by the independent variable before plotting.

Step Plot shows the type of plot INTERPOL=STEPJR produces. Plot symbols in the form of dots have been added to this figure.

Step Plot

[Step Plot]

Alias: I=STEP<placement><J><S>
LINE=line-type
L=line-type

specifies the line type of the plot line in the GPLOT procedure, or the contour line in the GCONTOUR procedure:

1

a solid line.

2...46

a dashed line.

Line types are shown in Line Types. By default, LINE=1.

Note:   This option overrides the LineStyle attribute in graph styles.

Neither the Java applet nor ActiveX control supports GCONTOUR.  [cautionend]

Restriction: Partially supported by Java and ActiveX
MODE=EXCLUDE | INCLUDE

specifies that any interpolation method exclude or include data values that are outside the range of plot axes. By default, MODE=EXCLUDE prevents values outside the axis range from being displayed.

If you control the range of values displayed on an axis by using HAXIS= and VAXIS= in the GPLOT procedure, or ORDER= in an AXIS definition, any data points that lie outside the range of the axes are discarded before interpolation is applied to the data. Using these options to control value ranges has a particularly noticeable effect on the high-low interpolation methods, which include INTERPOL=HILO, INTERPOL=BOX, and INTERPOL=STD. Regression analysis also represents only part of the original data.

Restriction: Not supported by Java and partially supported by ActiveX
See also: Values Out of Range
POINTLABEL<=(label-description(s)) | NONE>

labels plot points. The labels always use the format that is assigned to the variable or variables whose values are used for the labels. POINTLABEL without any specified descriptions labels points with the Y value. NONE suppresses the point labels. Label-description(s) can be used to change the variable whose values are used to label points, and to change features of the label text, such as the color, font, or size of the text.

Note:   If you do not specify a color on a SYMBOL statement, the symbol definition is rotated through the color list before the next SYMBOL statement is used. Thus, if your plot contains multiple plot lines and you want to limit your POINTLABEL specification to a single line, you must specify a color in the SYMBOL statement that contains the POINTLABEL description.  [cautionend]

Label-description(s) can be one or more of these:

COLOR=text-color

specifies the color of the label text. The default is the first color from the color list.

Alias: C=text-color
DROPCOLLISIONS | NODROPCOLLISIONS

specify DROPCOLLISIONS to drop new labels if they collide with a label already in use. Specify NODROPCOLLISIONS to retain all labels. The default is DROPCOLLISIONS.

The algorithm for the placement of markers tries to avoid placing labels such that they collide. If the algorithm is unable to avoid a collision, then the default DROPCOLLISIONS is to drop the new label, whereas NODROPCOLLISIONS retains even colliding labels.

FONT=font | NONE

specifies the font for the text. See Specifying Fonts in SAS/GRAPH Programs for details on specifying font. If you omit FONT=, a font specification is searched for in this order:

  1. the FTEXT= option in a GOPTIONS statement

  2. the default hardware font, NONE.

Alias: F=font | NONE
HEIGHT=text-height <units >

specifies the height of the text characters in number of units. By default, HEIGHT=1 CELL. If you omit HEIGHT=, a text height specification is searched for in this order:

  1. the HTEXT= option in a GOPTIONS statement

  2. the default value, 1.

Alias: H=text-height <units >
JUSTIFY=CENTER | LEFT | RIGHT

specifies the horizontal alignment of the label text. The default is CENTER. The location of the point label is relative to the location of the corresponding data point.

POSITION=TOP | MIDDLE | BOTTOM

specifies the vertical placement of the label text. The default is TOP. The location of the point label is relative to the location of the corresponding data point.

Alias: J=C | L | R
"#var" | "#x:#y <$char>" | "#y:#x <$char>"

specifies the variable or variables whose values label the plot points. The variable specification must be enclosed in either single or double quotation marks. The first specified variable must be prefixed with a pound sign (#). If a second variable is specified, it must be prefixed with a colon and a pound sign (:#). When you specify both the X and Y variables, you can also specify the character to display as the delimiter between variable values in the plot label.

By default if the POINTLABEL= option is specified without naming a label variable, the Y values label the plot points. You can change the default by using "#var" to specify a different variable whose values should label the points. For example, you might specify the name of the X variable. The following option specifies the variable SALES as the variable whose values label plot points:

POINTLABEL=("#sales")

Alternatively, you can label the plot points with the values of the X and Y variables, in either order. The order that you specify X and Y in the variable specification determines the order that the values are displayed in the label. The following option specifies variables HEIGHT and WEIGHT; in the label, the value for HEIGHT is displayed, followed by the value for WEIGHT:

POINTLABEL=("#height:#weight")
By default when you specify both the X and Y variables, a colon (:) displays in the label to separate the values in each label. To change the character that displays as the delimiter, use the $ syntax to specify an alternative character. The following option specifies a vertical bar (|) as the delimiter in the label:
POINTLABEL=("#height:#weight $|")
The $ syntax must be within the same quotation marks as the variable specification. The $ specification can precede or follow the variable specification, but it must be separated from the variable specification by at least one space.

Note:   Specifying a delimiting character with the $ only changes the character that displays in the label. It does not change the syntax of the variable specification, which requires a colon and pound sign (:#) to precede the second variable.  [cautionend]

Note:   There is a sixteen character length limit for each variable. A maximum character length limit of thirty-three characters is possible. This can be composed of X and Y variables, any other valid data set variable, and a separator as required.  [cautionend]

When creating output using the ActiveX or Java devices, the variables that you specify in the POINTLABEL= option must be for the plot's X and Y variables. Specifying any other variables causes unexpected labeling.

Specify as many label-description suboptions as you want. Enclose them all within a single set of parentheses, and separate each suboption from the others by at least one space.

Restriction: Partially supported by Java and ActiveX
REPEAT=number-of-times

specifies the number of times that a SYMBOL definition is applied before the next SYMBOL definition is used. By default, REPEAT=1.

The behavior of REPEAT= depends on whether any of the SYMBOL color options (CI=, CV=, CO=, and COLOR=) or the CSYMBOL= graphics option also is used:

  • If any SYMBOL color option also is used in the SYMBOL definition, that SYMBOL definition is repeated the specified number of times in the specified color.

  • If no SYMBOL color option is used but the CSYMBOL= graphics option is currently in effect, the SYMBOL definition is repeated the specified number of times in the specified color.

  • If no SYMBOL statement color options are used and the CSYMBOL= graphics option is not used, the SYMBOL definition is cycled through each color in the color list, and then the entire group generated by this cycle repeats the number of times specified by the REPEAT= option. Thus, the total number of iterations of the SYMBOL definition depends on the number of colors in the current color list.

    Neither the Java applet nor ActiveX control supports GCONTOUR.

Alias: R=number-of-times
See also: Using the SYMBOL Statement
Restriction: Partially supported by Java and ActiveX
SINGULAR=n

tunes the algorithm used to check for singularities. The default value is machine dependent but is approximately 1E-7 on most machines. This option is rarely needed.

STEP=distance<units>

specifies the minimum distance between labels on contour lines. The value of distance must be greater than zero. By default, STEP=65PCT.

Note:   If you specify units of PCT or CELLS, the STEP= option calculates the distance between the labels based on the width of the graphics output area, not the height. For example, if you specify STEP=50PCT and if the graphics output area is 9 inches wide, the distance specified is 4.5 inches. A value less than 10 percent is ignored and 10 percent is used instead.  [cautionend]

When you use the STEP= option, specify the minimum distance that you want between labels. The option then calculates how many labels it can fit on the contour line, taking into account the length of the labels and the minimum distance you specified. Once it has calculated how many labels it can fit while retaining the minimum distance between them, it places the labels, evenly spaced, along the line. Consequently, the space between labels can be greater than what you specify, although it will never be less.

In general, to increase the number of labels from the default, reduce the value of distance.

If the procedure cannot write the label at a particular location on the contour, for example because the contour line makes a sharp turn, the label might be placed farther along the line or omitted. If labels are omitted, a note appears in the log. Specifying a low value for the GCONTOUR procedure's TOLANGLE= option can also cause labels to be omitted, since this forces the procedure to select smoother labeling locations, which might not be available on some contours.

Featured in: Labeling Contour Lines, Modifying the Horizontal Axis, Modifying the Legend
Restriction: Not supported by Java and ActiveX
VALUE=special-symbol | text-string | NONE

  • specifies a plot symbol for the data points (GPLOT and GBARLINE). If you omit the SYMBOL statement, plot points are generated using the default plot symbol. The default symbol is a square if you use the ActiveX or Java devices and a PLUS sign for other devices. If you specify a SYMBOL statement, but do not specify the VALUE= option, plot symbols are suppressed.

    Note:   For ActiveX output, the VALUE= option is not supported when INTERPOL=HILO or INTERPOL=STD. You can use the OVERLAY option with GPLOT to get symbols to appear on the data points.  [cautionend]

  • specifies contour-label text in a contour plot (GCONTOUR). By default with the AUTOLABEL option, GCONTOUR labels contour lines with the contour variable's value at that contour level.

  • VALUE=NONE suppresses plot symbols at the data points, or labels on the contour lines. You can set the VALUE=NONE option independent of the INTERPOL= option.

Values for special-symbol are the names and characters shown in Special Symbols for Plotting Data Points. The special symbol table can be used only if the FONT= option is not used or a null value is specified:

font=,

To specify a single quotation mark, you must enclose it in double quotation marks

value="'"

To specify a double quotation mark, you must enclose it in single quotation marks:

value='"'

In some operating environments, punctuation characters might require single quotes.

If you use VALUE=text-string to specify a plot symbol, you must also use the FONT= option to specify a symbol font or a text font. If you specify a symbol font, the characters in the string are character codes for the symbols in the font. If you specify a text font, the characters in the string are displayed. If you specify a text string containing quotes or blanks, enclose the string in single quotes.

For example, if you specify this statement, the plot symbol is the word "plus" instead of the symbol +:

symbol font=swiss value=plus;

Java and ActiveX support the following characters from the marker font for special-symbol:

Marker-font symbols supported by Java and ActiveX
Character Aliases
Marker Cone, Pyramid, Default
Square Cube
Star
Circle Sphere, Dot, Balloon
Plus Cross
Flag Y
X
Prism Z
Spade "
Heart #
Diamond $
Club %
Hexagon Paw
Cylinder Hash

Note:   If you do not use a SYMBOL statement to specify a color for each symbol, but you do specify a color list in a GOPTIONS statement, then Java and ActiveX assign colors to symbols differently than do the other device drivers. To ensure consistency on all devices, you should specify the desired color of each symbol. If you do not specify a symbol color, SAS/GRAPH uses the first default color and the first symbol. It uses each color in the list of default colors until the list is exhausted. SAS/GRAPH then selects the next symbol and begins again with the first default color. It rotates the new symbol through the list of default colors before selecting another symbol. It continues selecting new symbols and colors until no more symbols are needed.   [cautionend]

Note:   The VALUE option overrides the MarkerSymbol attribute in graph styles.   [cautionend]

See also: the option FONT= and Specifying Plot Symbols.
Alias: V=special-symbol | text-string | NONE
Featured in: Example 3. Rotating Plot Symbols Through the Color List, Example 4. Creating and Modifying Box Plots, and Labeling Contour Lines, Modifying the Horizontal Axis, Modifying the Legend
Restriction: Partially supported by Java and ActiveX
WIDTH=thickness-factor

specifies the thickness of interpolated lines (GPLOT) or contour lines (GCONTOUR), where thickness-factor is a number. The thickness of the line increases directly with thickness-factor. By default, WIDTH=1.

WIDTH= also affects all the lines in box plots (INTERPOL=BOX), high-low plots with bars (INTERPOL=HILOB), and standard deviation plots (INTERPOL=STD). It also affects the outlines of the area generated by the AREAS= option in the PLOT statement of the GPLOT procedure.

Note:   By default, the value specified by WIDTH= is used as the default value for the BWIDTH= option. For example, specifying WIDTH=6 also sets BWIDTH= to 6 unless you explicitly assign a value to BWIDTH=.

Java and ActiveX do not provide the same measure of control for width as SAS/GRAPH device drivers. Measurements are translated to pixels rather than a percentage. For DEVICE=JAVA and DEVICE=ACTIVEX the maximum width is 6.  [cautionend]

Style Reference: LineThickness attribute of the GraphAxisLines element
Alias: W=thickness-factor
Featured in: Example 1. Ordering Axis Tick Marks with SAS Date Values and Example 4. Creating and Modifying Box Plots
Restriction: Partially supported by Java and ActiveX

Special Symbols for Plotting Data Points

[Special Symbols for Plotting Data Points]

Note:   The words or special characters in the VALUE= column are entered exactly as shown.  [cautionend]


Using the SYMBOL Statement

A SYMBOL statement specifies one or more options that indicate the color and other attributes used by the GPLOT, GBARLINE, and GCONTOUR procedures. For GPLOT and GBARLINE, the main attributes include the plot symbol, interpolation method, and type of plot line. For GCONTOUR, the main attributes include the type of contour lines used and the text used to label those lines.

Note:   SYMBOL statements can be applied only to contour plots when the AUTOLABEL option is specified on GCONTOUR.  [cautionend]

You can define up to 255 different SYMBOL statements. A SYMBOL statement without a number is treated as a SYMBOL1 statement.

SYMBOL definitions can be defined anywhere in your SAS program. They are global and remain in effect until canceled or until you end your SAS session. Once defined, SYMBOL definitions can be used as follows:

SYMBOL statements generate one or more symbol definitions, depending on how color is used and whether a plot symbol or type of contour line is specified. For more information, see Controlling Consecutive SYMBOL Statements and Using Generated Symbol Sequences.

Although it is common practice, you do not have to start with SYMBOL1, and you do not have to use sequential statement numbers. When assigning SYMBOL definitions, SAS/GRAPH software starts with the lowest-numbered definition and works upward, ignoring gaps in the numbering.


Altering or Canceling SYMBOL Statements

SYMBOL statements are additive. If you define a SYMBOL statement and later submit another SYMBOL statement with the same number, the new SYMBOL statement defines or cancels only the options that are included in the new statement. Options that are not included in the new statement are not changed and remain in effect.

Note:   An exception to this rule is presented by POINTLABEL= suboptions which are not carried over to subsequent SYMBOL statements.  [cautionend]

Assume you define SYMBOL4 as follows:

symbol4 value=star cv=red height=4;

The following statement cancels only HEIGHT= without affecting the rest of the definition:

symbol4 height=;

Add or change options in the same way. This statement adds an interpolation method to SYMBOL4:

symbol4 interpol=join;

This statement changes the color of the plot symbol from red to blue:

symbol4 cv=blue;

After all these modifications, SYMBOL4 has these characteristics:

symbol4 value=star cv=blue interpol=join;

Cancel individual SYMBOL statements by defining a SYMBOL statement of the same number without options (a null statement):

symbol4;

Canceling one SYMBOL statement does not affect any other SYMBOL definitions. To cancel all current SYMBOL statements, use the RESET= option in a GOPTIONS statement:

goptions reset=symbol;

Specifying RESET=GLOBAL or RESET=ALL cancels all current SYMBOL definitions as well as other settings.

To display current SYMBOL definitions in the Log window, use the GOPTIONS procedure with the SYMBOL option:

proc goptions symbol nolist;
run;


Controlling Consecutive SYMBOL Statements

If you specify consecutively numbered SYMBOL statements and you want SAS/GRAPH to use each definition only once, use color specifications to ensure that each SYMBOL statement generates only one symbol definition. You can do the following actions:

For more information on specifying colors for symbol definitions, see Using Color.

If you do not use color to limit a SYMBOL statement to a single symbol definition, SAS/GRAPH generates multiple symbol definitions from that statement by rotating the current definition through the color list (for more details, see Using Generated Symbol Sequences). Because SAS/GRAPH uses symbol definitions in the order they are generated, this means that the nth symbol definition applied to a graph does not necessarily correspond to the SYMBOLn statement.

For example, assuming that no color is specified on the CSYMBOL= graphics option, these statements generate four definitions:

goptions colors=(red blue green);
symbol1 value=star;
symbol2 value=square color=yellow;

Because no color is specified on SYMBOL1, SAS/GRAPH rotates the symbol definition through the color list, which has three colors. Thus, SYMBOL1 defines the first three applied symbol definitions, and SYMBOL2 defines the 4th:

Sequence Number Source Characteristics: Color Symbol
1 SYMBOL1 red star
2 SYMBOL1 blue star
3 SYMBOL1 green star
4 SYMBOL2 yellow square

In this case, if a graph needs only three symbols, the SYMBOL2 definition is not used.

To make the nth applied symbol definition correspond to the SYMBOLn statement, limit each SYMBOL statement to a single color, using one of the techniques listed at the beginning of this section.


Setting Definitions for PROC GPLOT and PROC GBARLINE

The following topics apply only for SYMBOL statements used with PROC GPLOT and PROC GBARLINE:


Specifying Plot Symbols

The VALUE= option specifies the plot symbols that PROC GPLOT and PROC GBARLINE uses to mark the data points on a plot. Plot symbols can be in the following forms:

By default, the plot symbol is the + symbol. To specify a special symbol, use the VALUE= option to specify a name or a character from Special Symbols for Plotting Data Points:

symbol1 value=hash color=green;
symbol2 value=) color=blue;

This example uses color to ensure that each SYMBOL statement generates only one definition. You can omit color specifications to let SAS/GRAPH rotate symbol definitions through the color list. For details, see Using Generated Symbol Sequences.

To use plot symbols other than those in Special Symbols for Plotting Data Points, use the FONT= option to specify a font for the plot symbol. If the font is a symbol font, such as Marker, the string specified with the VALUE= option is the character code for the symbol to be displayed. If the font is a text font, the string specified with the VALUE= option is displayed as the plot symbol. (See VALUE= and FONT=.)

This table illustrates some of the ways you can define a plot symbol:

Definition Plot Symbol
symbol1 value=plus; [symbol1 value=plus]
symbol2 value=+; [symbol2 value=+]
symbol3 font=swiss value=plus; [symbol3 value=plus]
symbol4 font=marker value=U; [symbol4 value=squareblock]
symbol5 value="'"; [symbol5 value=fleur-de-lys]


Specifying a Default Interpolation Method

The INTERPOL= option in a GOPTIONS statement specifies a default interpolation method to be used with all SYMBOL definitions. This default interpolation method is in effect unless you specify a different interpolation in a SYMBOL statement. If the GOPTIONS statement does not specify an interpolation method, the default for each SYMBOL statement is NONE.


Sorting Data with Spline Interpolation

If you want the GPLOT procedure to sort by the horizontal axis variable before plotting, add the letter S to the end of any of the spline interpolation methods (INTERPOL=L, INTERPOL=SM, and INTERPOL=SPLINE). For example, suppose you want to overlay three plots (Y1*X1, Y2*X2, and Y3*X3) and for each plot, you want the X variable sorted in ascending order. Use these statements:

symbol1 i=splines c=red;
symbol2 i=splines c=blue;
symbol3 i=splines c=green;

proc gplot;
   plot y1*x1 y2*x2 y3*x3 / overlay;
run;


Using Color

Generally, there are two ways to explicitly specify color for SYMBOL statements:

You can also let SAS/GRAPH rotate symbol definitions through the color list. For details, see Using Generated Symbol Sequences.


Specifying Colors with SYMBOL Statements

The SYMBOL statement has these options for specifying color:

The CV= and CI= options have the same effect as using the COLOR= option when they are used in these ways:

In general, the CI=, CV=, and CO= options color specific areas of the symbol. Use these options to produce symbols and plot lines of different colors without having to overlay multiple plot pairs. For example, if you request regression analysis with confidence limits, use this statement to assign red to the plot symbol, blue to the regression lines, and green to the confidence limit lines:

symbol cv=red ci=blue co=green;

The COLOR= option colors the entire symbol or those portions of it not colored by one of the other color options. If the COLOR= option precedes the CI= or CV= options, the CI= or CV= specification is used instead. If none of the SYMBOL color options is used, color specifications are searched for in this order:

  1. the CSYMBOL= option in a GOPTIONS statement

  2. each color in the color list sequentially before the next SYMBOL definition is used

CAUTION:
If no color options are used, the SYMBOL definition cycles through each color in the color list.

  [cautionend]

If the SYMBOL color options and the CSYMBOL= graphics option are not used, the SYMBOL definition cycles through each color in the color list before the next definition is used. For details, see Using Generated Symbol Sequences.


Specifying Color with CSYMBOL=

The CSYMBOL= option in the GOPTIONS statement specifies the default color to be used by all SYMBOL definitions:

goptions csymbol=green;
symbol1 value=star;
symbol2 value=square;

In this example, both SYMBOL statements use green.

CSYMBOL= is overridden by any of the SYMBOL statement color options. See Using Color for details.

If more SYMBOL definitions are needed, SAS/GRAPH returns to generating default symbol sequences.


Specifying Line Types

To specify the type of line for plot or contour lines, use the LINE= option to specify a number from 1 through 46. Line Types shows the line types represented by these numbers. By default, the line type is 1 for plot and contour lines, and 2 for confidence limit lines.

Line Types

[Line Types]

Note:   These line types are also used by other statements and procedures. Some options accept a line type of 0, which produces no line.  [cautionend]


Using Generated Symbol Sequences

Symbol sequences are sets of SYMBOL definitions that are automatically generated by SAS/GRAPH software if any of these conditions is true:

If the REPEAT= option is also used, the resulting SYMBOL definition is repeated the specified number of times.


Default Symbol Sequences

Default symbol sequences are generated by rotating symbol definitions through the current color list.

Each time a default definition is required, SAS/GRAPH takes the first default plot symbol or line type and uses it with the first color in the color list. If more than one definition is required, it uses the same plot symbol or line type with the next color in the color list and continues until all the colors have been used once. If more definitions are needed, SAS/GRAPH selects the second default plot symbol or line type and rotates it through the color list. It continues in this fashion, selecting default plot symbols or line types and cycling them through the color list until all the required definitions are generated.

If a color has been specified with the CSYMBOL= option in the GOPTIONS statement, each default plot symbol or line type is used once with the specified color, and the colors in the color list are ignored.


Symbol Sequences Generated from SYMBOL Statements

If a SYMBOL statement does not specify color, and if the CSYMBOL= graphics option is not used, the symbol definition is rotated through every color in the color list before the next SYMBOL definition is used:

goptions colors=(blue red green);
symbol1 cv=red i=join;
symbol2 i=spline v=dot;
symbol3 cv=green v=star;

Here, the SYMBOL1 statement generates the first SYMBOL definition. The SYMBOL2 statement does not include color, so the first default plot symbol is rotated through all colors in the color list before the SYMBOL3 statement is used. This table shows the colors and symbols that would be used if nine symbol definitions were required for PROC GPLOT:

Sequence Number Source Characteristics: Color Symbol Interpolation
1 SYMBOL1 cv=red first default join
2 SYMBOL2 color=blue dot spline
3 SYMBOL2 color=red dot spline
4 SYMBOL2 color=green dot spline
5 SYMBOL3 cv=green star NONE
6 first default color=blue first default default
7 first default color=red first default default
8 first default color=green first default default
9 second default color=blue second default default

Notice that after the SYMBOL statements are exhausted, the procedure begins using the default definitions (sequences 6 through 9). Each plot symbol from the default list is rotated through all colors in the color list before the next plot symbol is used. Also, SYMBOL1 does not specify a plot symbol, so the default sequencing provides the first default symbol (a + sign). When sequencing resumes in sequence number 6, it starts at the beginning again, selecting the first default plot symbol and rotating it through the color list.

If you use the REPEAT= option but no color, the sequence generated by cycling the definition through the color list is repeated the number of times specified by the REPEAT= option. For example, these statements define a color list and illustrate the effect of the REPEAT= option on SYMBOL statements both with and without explicit color specifications:

goptions colors=(blue red green);
symbol1 color=gold repeat=2;
symbol2 value=star color=cyan;
symbol3 value=square repeat=2;

Here, SYMBOL1 is used twice, SYMBOL2 is used once, and SYMBOL3 rotates through the list of three colors and then repeats this cycle a second time:

Sequence Number Source Characteristics: Color Symbol Interpolation
1 SYMBOL1 gold first default default
2 SYMBOL1 gold first default default
3 SYMBOL2 cyan star default
4 SYMBOL3 blue square default
5 SYMBOL3 red square default
6 SYMBOL3 green square default
7 SYMBOL3 blue square default
8 SYMBOL3 red square default
9 SYMBOL3 green square default


FOOTNOTE 1:   Reinsch, C.H. (1967), "Smoothing by Spline Functions," Numerische Mathematik, 10, 177-183. [arrow]

FOOTNOTE 2:   Pizer, Stephen M. (1975), Numerical Computing and Mathematical Analysis, Chicago: Science Research Associates, Inc., Chapter 4. [arrow]

Previous Page | Next Page | Top of Page