Previous Page | Next Page

The SGPLOT Procedure

BAND Statement


Creates a band that highlights part of the plot.
Restriction: The axis that the UPPER and LOWER values are placed on cannot be a discrete axis. For example, if you specify a variable for Y, the plot cannot use a discrete horizontal axis.
Featured in: Creating Lines and Bands from Pre-Computed Data


Syntax

BAND X= variable | Y= variable
UPPER= numeric-value | numeric-variable LOWER= numeric-value | numeric-variable
</option(s)>;

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


Required Arguments

X= variable | Y=variable

specifies a variable that is used to plot the band along the x or y axis.

LOWER= numeric-value | numeric-variable

specifies the lower value for the band. You can specify either a constant numeric value or a numeric variable.

UPPER= numeric-value | numeric-variable

specifies the upper value for the band. You can specify either a constant numeric value or a numeric variable.


Options

FILL | NOFILL

specifies whether the area fill is visible. The FILL option shows the area fill. The NOFILL option hides the area fill.

Default: The default status of the area fill is specified by the DisplayOpts attribute of the GraphBand style element in the current style.
FILLATTRS= style-element | (COLOR= color)

specifies the appearance of the area fill for the band. You can specify the color of the fill by using a style element or by using the COLOR= suboption. For more information about specifying colors, see SAS/GRAPH Colors and Images in the SAS/GRAPH: Reference, Second Edition.

Note:   This option has no effect if you specify the NOFILL option.  [cautionend]

Default: For ungrouped data, the default color is specified by the Color attribute of the GraphDataConfidence style element in the current style.

For grouped data, the default color is specified by the Color attribute of the GraphData1... GraphDatan style elements in the current style.

GROUP= variable

specifies a variable that is used to group the data. A separate band is created for each unique value of the grouping variable. The plot elements for each group value are automatically distinguished by different visual attributes.

LEGENDLABEL= "text-string"

specifies a label that identifies the elements from the band plot in the legend. By default, the label "band" is used for ungrouped data, and the group values are used for grouped data.

Interaction: The LEGENDLABEL= option has no effect if you also specify the GROUP= option in the same plot statement.
LINEATTRS= style-element <(options)> | (options)

specifies the appearance of the outlines for the band. You can specify the appearance by using a style element or by using suboptions. If you specify a style element, you can additionally specify suboptions to override specific appearance attributes.

Note:   This option has no effect unless you also specify the OUTLINES option.  [cautionend]

options can be one or more of the following:

COLOR= color

specifies the color of the line. For more information about specifying colors, see SAS/GRAPH Colors and Images in the SAS/GRAPH: Reference, Second Edition.

Default: For ungrouped data, the default color is specified by the ContrastColor attribute of the GraphConfidence style element in the current style.

For grouped data, the default color is specified by the ContrastColor attribute of the GraphData1 ... GraphDatan style elements in the current style.

PATTERN= line-pattern

specifies the line pattern for the line. You can reference SAS patterns by number or by name. See Line Patterns for a list of line patterns.

Default: For ungrouped data, the default line pattern is specified by the LineStyle attribute of the GraphConfidence style element in the current style.

For grouped data, the default line pattern is specified by the LineStyle attribute of the GraphData1 ... GraphDatan style elements in the current style.

THICKNESS= n <units>

specifies the thickness of the line. You can also specify the unit of measure. The default unit is pixels. See Units of Measurement for a list of the measurement units that are supported.

Default: For ungrouped data, the default line thickness is specified by the LineThickness attribute of the GraphDataDefault style element in the current style.

For grouped data, the default line thickness is specified by the LineThickness attribute of the GraphData1 ... GraphDatan style elements in the current style.

MODELNAME= "plot-name"

specifies a plot that is used as a model for the interpolation for the band. If you do not specify the MODELNAME= option, then the band is interpolated in the same way as a series plot.

NAME= "text-string"

specifies a name for the plot. You can use the name to refer to this plot in other statements.

NOEXTEND

when you specify numeric values for UPPER= and LOWER=, specifies that the band does not extend beyond the first and last data points in the plot. By default, the band extends to the edges of the plot area.

Interaction: This option has no effect if you do not specify numeric values for the UPPER= and LOWER= options.
Restriction: This option is available with SAS 9.2 Phase 2 and later.
NOMISSINGGROUP

specifies that missing values of the group variable are not included in the plot.

Restriction: This option is available with SAS 9.2 Phase 2 and later.
OUTLINE | NOOUTLINE

specifies whether the outlines of the band are visible. The OUTLINE option shows the outlines. The NOOUTLINE option hides the outlines.

Default: The default status of the band outlines is specified by the DisplayOpts attribute of the GraphBand.
TRANSPARENCY= value

specifies the degree of transparency for the plot. Specify a value from 0.0 (completely opaque) to 1.0 (completely transparent).

Default: 0.0
X2AXIS

assigns the variables that are assigned to the primary (bottom) horizontal axis to the secondary (top) horizontal axis.

Y2AXIS

assigns the variables that are assigned to the primary (left) vertical axis to the secondary (right) vertical axis.


Details

The MODELNAME= option fits a band to another plot. This is particularly useful for plots that use a special interpolation such as step plots.

The following code fragment fits a band to a step plot:

band x=t upper=ucl lower=lcl / modelname="myname" transparency=.5;
step x=t y=survival / name="myname";

Fitted Band Plot Example

[Fitted Band Plot]

Previous Page | Next Page | Top of Page