SAS Institute. The Power to Know
TEMPLATE Procedure: Plot Statements (Experimental)

BAND Statement


Displays bands for statistical limits, and typically is used to add confidence or prediction bands to a plot.
BAND X= numeric-column | expression
YLIMITLOWER= number | numeric-column | expression
YLIMITUPPER= number | numeric-column | expression
< / option(s)> ;
BAND Y= numeric-column | expression
XLIMITLOWER= number | numeric-column | expression
XLIMITUPPER= number | numeric-column | expression
< / option(s)> ;


Usage Information

Band Plot

[Band Plot]

Requirement:

A band plot can specify an X column with Y upper and lower limits, or a Y column with X upper and lower limits. If you specify the X argument, you must specify YLIMITLOWER and YLIMITUPPER arguments. If you specify the Y argument, you must specify XLIMITLOWER and XLIMITUPPER arguments.

Tip:

When used to display prediction or confidence limits, a band plot must be used with another plot that specifies a fitted model, such as a series, step, or needle plot. In these cases, the band does not include the model line, so the MODELNAME= option must be used on the BANDPLOT statement to identify the model from which to derive the interpolation for the band. The name specified on the MODELNAME= option would be the name assigned to the other plot on its NAME= option. The upper and lower limits would be specified by numeric columns.

Tip:

A band plot can also be used to generate areas in the display that are independent of other plots but enhance the display. For example, a band plot can be used to define yellow and green areas in an OVERLAY LAYOUT statement that also contains a scatter plot, implying concern for any of the scatter plot values that fall in the yellow area and comfort for any values that fall in the green area. For this use, the upper and lower limits would be specified by a constant.


Required Arguments

X

specifies the X values.

Requirement: If you use the X= argument, then you must also use the YLIMITLOWER= and the YLIMITUPPER= arguments to specify the lower and upper Y lines for the band.
YLIMITLOWER

specifies a number representing the lower Y value or column of values for the lower Y line.

Requirement: The YLIMITLOWER= argument must be used when X values are specified.
Interaction: If a number is specified, then a horizontal line is displayed.
YLIMITUPPER

specifies a number representing the upper Y value or column of values for the upper Y line.

Requirement: The YLIMITUPPER= argument must be used when X values are specified.
Interaction: If a number is specified, then a horizontal line is displayed.
Y

specifies Y values.

Requirement: If you use the Y= argument, then you must also use the XLIMITLOWER= and the XLIMITUPPER= arguments to specify the lower and upper X lines for the band.
XLIMITLOWER

specifies a number representing the lower X value or column of values for the lower X line.

Requirement: The XLIMITLOWER= argument must be used when Y values are specified.
Interaction: If a number is specified, then a vertical line is displayed.
XLIMITUPPER

specifies a number representing the upper X value or column of values for the upper X line.

Requirement: The XLIMITUPPER= argument must be used when Y values are specified.
Interaction: If a number is specified, then a vertical line is displayed.

Options

BAND Options
Option Description
BACKGROUND= color | style-reference Specifies the background color of the graph.
BACKTRANSPARENCY= number Specifies the degree of the transparency of the background color.
DATATRANSPARENCY= number Specifies the degree of the transparency of the band.
EXTREME= boolean Specifies whether a constant band is to be drawn to the area bounded by the axes.
FILL= boolean Specifies whether to fill between the lines of the band.
FILLCOLOR= color | style-reference Specifies the color of the area between the lines of the band.
GROUP= column Creates a separate band plot for each unique group value of the specified column.
INDEX= integer-column Specifies indices for remapping the assignment of the color and line pattern to group values.
LEGENDLABEL= 'string' Specifies the label of the legends.
LINECOLOR= color | style-reference Specifies the color of the band lines.
LINEPATTERN= line | style-reference Specifies the line pattern of the band lines.
LINES= boolean Specifies that the band lines are displayed.
LINETHICKNESS= dimension | style-reference Specifies the thickness of the band lines.
MODELNAME= 'string' Specifies the name of the plot from which to derive the interpolation for the band.
NAME= 'string' Assigns a name to a plot statement for reference in other template statements.
TIP= ( column-list ) Specifies the information to display when the cursor is positioned over a graph element in the data area.
TRANSPARENCY= number Specifies the degree of the transparency of all elements of the graph.
XAXIS= X | X2 Specifies whether data is mapped to the primary X axis or the secondary X (X2) axis.
XMAX= number Specifies the maximum X data value to use in the bands.
XMIN= number Specifies the minimum X data value to use in the bands.
YAXIS= Y | Y2 Specifies whether data is mapped to the primary Y axis or the secondary Y (Y2) axis.
YMAX= number Specifies the maximum Y data value to use in the bands.
YMIN= number Specifies the minimum Y data value to use in the bands.

BACKGROUND= color | style-reference

specifies the background color of the graph.

Default: Specified by the GraphBackground:Background style reference.
Interaction: Ignored in a LAYOUT OVERLAY block. For information, see Ignored Plot Options in a LAYOUT OVERLAY Block.
BACKTRANSPARENCY= number

specifies the degree of the transparency of the background color.

Default: 0
Range: 0 (opaque) to 1 (entirely transparent)
Interaction: The BACKTRANSPARENCY= option overrides the TRANSPARENCY= option for the background.
Interaction: Ignored in a LAYOUT OVERLAY block. For information, see Ignored Plot Options in a LAYOUT OVERLAY Block.
See also: TRANSPARENCY= option
DATATRANSPARENCY= number

specifies the degree of the transparency of the band.

Default: 0
Range: 0 (opaque) to 1 (entirely transparent)
Interaction: The DATATRANSPARENCY= option overrides the TRANSPARENCY= option for the band.
See also: TRANSPARENCY= option
EXTREME= boolean

specifies whether a constant band is to be drawn to the area bounded by the axes.

Default: FALSE
Interaction: The EXTREME= option is not affected by the XMAX=, XMIN=, YMAX=, and YMIN= options.
Tip: If the EXTREME= option is not specified, there can be a small gap between the line and the axis. The gap is controlled by the axis offset. If the offset is set to 0, then there is no gap.
FILL= boolean

specifies whether to fill between the lines of the band.

Default: FALSE
FILLCOLOR= color | style-reference

specifies the fill color of the area between the lines of the band.

Default: If the GROUP= option is not specified, then the default fill color is specified by the GraphDataDefault:foreground style reference.

If the GROUP= option is specified, then the fill color is specified by the ContrastColor style attribute on the GraphData1 - GraphData12 style elements.

GROUP= column

creates a separate band plot for each unique group value of the specified column.

Default: Each distinct group value is represented in the graph by a different combination of the line color and line pattern.
Restriction: The GROUP= option can only be used when a numeric column is specified for the upper or lower limits of the band plot.
Tip: If error bars are displayed, then the bars are assigned the color and line pattern of its group.
Tip: The representations that are used to identify the groups can be overridden individually. For example, each distinct group value is represented by a different line pattern for the band lines, but the LINEPATTERN= option could be used to assign the same line pattern to all lines.
INDEX= integer-column

specifies indices for remapping the assignment of the color and line pattern to group values.

Restriction: The INDEX= option must be used with the GROUP= option. If the GROUP= option is not specified, then the INDEX= option is ignored.
Interaction: If the INDEX= option is not used, then the group values are mapped in the order of the data.
LEGENDLABEL= 'string'

specifies the label of the legends.

Default: No label
Interaction: The GROUP= option overrides the LEGENDLABEL= option.
LINECOLOR= color | style-reference

specifies the color of the band lines.

Default: If the GROUP= option is specified, then the color is specified by the contrast color in the GraphData1 - GraphData12 style elements.

If the GROUP= option is not specified, then the color is specified by the GraphDataDefault:ContrastColor style reference.

LINEPATTERN= line | style-reference

specifies the line pattern of the band lines.

Default: If the GROUP= option is not specified, then a solid line pattern is used.

If the GROUP= option is specified, then line patterns are specified by the LineStyle attribute in the GraphData1 - GraphData12 style elements.

If the GraphData1 - GraphData12 style elements do not define the LineStyle attribute, then a default sequence of line patterns is used.

Interaction: The LINEPATTERN= option overrides the default line mapping for group values.

LINES= boolean

specifies whether the band lines are displayed.

Default: TRUE
Interaction: The LINES= option applies to the band limits and can be used to display a filled band without displaying the upper and lower limit lines. When LINES=FALSE, the FILL= option should be used to specify a fill for the band area.
Interaction: If LINES=FALSE and the FILL= option is not specified, then a default fill is used to prevent an empty display.
Interaction: If LINES=FALSE and FILL=FALSE, then the lines are drawn to prevent an empty display.
LINETHICKNESS= dimension | style-reference

specifies the thickness of the band lines.

Default: 1 px
MODELNAME= 'string'

specifies the name of the plot from which to derive the interpolation for the band.

Restriction: The MODELNAME= option can only be used when a numeric-column is specified for the upper or lower limits of a band plot .
Requirement: The string value specified for the MODELNAME= option must be the name that has been assigned to the associated plot on its NAME= option.
Tip: If the MODELNAME= option is not specified, then the interpolation is assumed to be consistent with a SERIES plot.
Tip: When the MODELNAME= option is used, the band plot forms prediction or confidence limits for the plot that supplies the fitted model.
NAME= 'string'

assigns a name to a plot statement for reference in other template statements.

Restriction: The string specified by the NAME= option must be unique within the template.
Restriction: The string specified by the NAME= option cannot contain embedded spaces.
Tip: The NAME= option is used mostly in the DISCRETELEGEND statement in order to coordinate the use of colors, marker symbols, and line patterns between the graph and the legend.
Tip: string is case sensitive.
TIP= ( column-list )

specifies the information to display when the cursor is positioned over a graph element.

Default: All of the variables specified for the graph.
Requirement: You can activate tool tips in a SAS program by specifying an ODS GRAPHICS statement that has IMAGEFMT=STATICMAP specified.
Requirement: Tool tips are only available for graphs that are written to the ODS HTML destination. Tool tips are only displayed if they are activated by the SAS program that generates the ODS graphics output.
TRANSPARENCY= number

specifies the degree of the transparency of all of the elements of the graph.

Default: 0
Range: 0 (opaque) to 1 (entirely transparent)
Interaction: You can specify the transparency of the bands and the background individually with the BACKTRANSPARENCY= and DATATRANSPARENCY= options.
Interaction: In a LAYOUT OVERLAY block, the TRANSPARENCY= option only affects the bands. The LAYOUT OVERLAY statement specifies the transparency of the background.
XAXIS= X | X2

specifies whether data is mapped to the primary X axis or the secondary X (X2) axis.

Default: X
Interaction: Within a LAYOUT OVERLAY block, multiple plots can share a primary axis and a secondary axis. The primary and secondary axes can have different scales, and the XAXIS= option for a particular plot can map data to either axis. The XAXISOPTS= and X2AXISOPTS= options of a LAYOUT OVERLAY statement specify whether the axes are displayed, and specify the axis characteristics.
XMAX= number

specifies the maximum X data value to use in the bands.

Default: Maximum X value in the data.
Restriction: If the data contains values that are less than the number specified for the XMAX= option, then the data values are excluded from the bands.
Interaction: The XMAX= option does not affect the EXTREME= option. The EXTREME= option extends the line.
XMIN= number

specifies the minimum X data value to use in the bands.

Default: Minimum X value in the data.
Restriction: If the data contains values that are less than the number specified for the XMIN= option, then the data values are excluded from the bands.
Interaction: The XMIN= option does not affect the EXTREME= option. The EXTREME= option extends the line.
YAXIS= Y | Y2

specifies whether data is mapped to the primary Y axis or the secondary Y (Y2) axis.

Default: Y
Interaction: Within a LAYOUT OVERLAY block, multiple plots can share a primary axis and a secondary axis. The primary and secondary axes can have different scales, and the YAXIS= option for a particular plot can map data to either axis. The YAXISOPTS= and Y2AXISOPTS= options of a LAYOUT OVERLAY statement specify whether the axes are displayed, and specify the axis characteristics.
YMAX= number

specifies the maximum Y data value to use in the bands.

Default: Maximum Y value in the data.
Restriction: If the data contains values that are less than the number specified for the YMAX= option, then the data values are excluded from the bands.
Interaction: The YMAX= option does not affect the EXTREME= option. The EXTREME= option extends the line.
YMIN= number

specifies the minimum Y data value to use in the bands.

Default: Minimum Y value in the data.
Restriction: If the data contains values that are less than the number specified for the YMIN= option, then the data values are excluded from the bands.
Interaction: The YMIN= option does not affect the EXTREME= option. The EXTREME= option extends the line.


Previous Page | Next Page | Top of Page