SGPANEL 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.
Note: The input data should be sorted by the X or Y variable. If the data is not sorted, the graph might produce unpredictable results.
About Band Plots

Syntax

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

Summary of Optional Arguments

Band options
specifies an amount to offset all bands from discrete X or Y tick values.
specifies whether the area fill is visible.
specifies the appearance of the area fill for the band.
specifies the appearance of the lines in the plot.
specifies that the band should be interpolated in the same way as the specified plot.
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.
specifies that missing values of the group variable are not included in the plot.
specifies whether the outlines of the band are visible.
specifies how the data points for the lower and upper band boundaries are connected.
Label options
specifies the appearance of the labels in the plot when you specify a curve label.
adds a label to the lower edge of the band.
specifies the location of the curve label.
adds a label to the upper edge of the band.
Plot options
specifies the value of the ID variable in an attribute map data set.
specifies a variable that is used to group the data.
specifies a label that identifies the elements from the band plot in the legend.
specifies a name for the plot.
specifies the degree of transparency for the area fill.

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.

Optional Arguments

ATTRID= variable
specifies the value of the ID variable in an attribute map data set. You specify this option only if you are using an attribute map to control visual attributes of the graph. For more information, see Using SG Attribute Maps to Control Visual Attributes.
CURVELABELATTRS= style-element <(options)> | (options)
specifies the appearance of the labels in the plot when you specify a curve label. You can specify the appearance by using a style element or by using suboptions. If you specify a style element, you can also specify suboptions to override specific appearance attributes.
Here is an example that specifies a style element: CURVELABELATTRS=GraphTitleText
options can be one or more of the following:
COLOR= color
specifies the color of the line label characters. You can specify colors using the same color schemes that are supported by SAS/GRAPH software. For more information, see Color-Naming Schemes in SAS/GRAPH: Reference.
Default:For ungrouped data, the default color is specified by the Color attribute of the GraphValueText 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.
FAMILY= “font-family
specifies the font family for the label characters. The SAS ODS styles use TrueType system fonts. For more information, see TrueType Fonts Supplied by SAS in SAS Language Reference: Concepts.
Default:The default font family is specified by the FontFamily attribute of the GraphValueText style element in the current style.
Restriction:You cannot specify a list of font family names.
SIZE= n <units>
specifies the font size of the label characters. You can also specify the unit of measurement. The default unit is pixels. For a list of measurement units that are supported, see Units of Measurement.
Default:The default font size is specified by the FontSize attribute of the GraphValueText style element in the current style.
STYLE= ITALIC | NORMAL
specifies whether the label characters are italic or normal.
Default:The default font style is specified by the FontStyle attribute of the GraphValueText style element in the current style.
WEIGHT= BOLD | NORMAL
specifies whether the label characters are bold or normal.
Default:The default font weight is specified by the FontWeight attribute of the GraphValueText style element in the current style.
Here is an example expression:
CURVELABELATTRS=(Color=Green Family=Arial Size=8 Style=Italic Weight=Bold)
Default:The default style element is GraphValueText.
Interaction:This option has no effect unless CURVELABELLOWER or CURVELABELUPPER is also specified.
CURVELABELLOWER = “text-string
adds a label to the lower edge of the band. Specify the label text.
CURVELABELPOS= MIN | MAX | START | END
specifies the location of the curve label. Specify one of the following values:
MIN
places the label at the part of the curve closest to the minimum X axis value.
MAX
places the label at the part of the curve closest to the maximum X axis value.
START
places the curve label at the first point on the curve.
END
places the curve label at the last point on the curve.
Default:END
Interaction:This option has no effect unless the CURVELABEL option is also specified.
CURVELABELUPPER = “text-string
adds a label to the upper edge of the band. Specify the label text.
DISCRETEOFFSET= numeric-value
specifies an amount to offset all bands from discrete X or Y tick values. Specify a value from -0.5 (left offset) to +0.5 (right offset).
Default:0.0 (no offset)
Requirement:This option is applicable only when the X or Y axis is discrete.
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 style attribute of the GraphBand style element in the current style.
Interactions:Specifying FILL also hides any visible outlines.

If NOFILL and NOOUTLINE are both specified, then both options are ignored.

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. You can specify colors using the same color schemes that are supported by SAS/GRAPH software. For more information, see Color-Naming Schemes in SAS/GRAPH: Reference.
Default:For ungrouped data, the default color is specified by the Color attribute of the GraphConfidence 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.

Interaction:This option has no effect if you specify the NOFILL option.
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.
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 lines in the plot. You can specify the appearance by using a style element or by using suboptions. If you specify a style element, you can also specify suboptions to override specific appearance attributes.
options can be one or more of the following:
COLOR= color
specifies the color of the line. You can specify colors using the same color schemes that are supported by SAS/GRAPH software. For more information, see Color-Naming Schemes in SAS/GRAPH: Reference.
Default:For ungrouped data, the default color is specified by the ContrastColor attribute of the GraphDataDefault 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. For a list of line patterns, see Line Patterns.
Default:For ungrouped data, the default line pattern is specified by the LineStyle attribute of the GraphDataDefault 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. For a list of measurement units that are supported, see Units of Measurement.
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 that the band should be interpolated in the same way as the specified plot. 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.
Note:The name is case-sensitive. When you refer to the specified name in other statements, you must use the same exact capitalization.
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.
NOMISSINGGROUP
specifies that missing values of the group variable are not included in the plot.
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 style element in the current style.
Interactions:Specifying OUTLINE also hides the fill color.

If NOOUTLINE and NOFILL are both specified, then both options are ignored.

TRANSPARENCY= numeric-value
specifies the degree of transparency for the area fill. Specify a value from 0.0 (completely opaque) to 1.0 (completely transparent).
Default:0.0
TYPE= SERIES | STEP
specifies how the data points for the lower and upper band boundaries are connected. You can specify one of the following:
SERIES
the data points are connected directly using line segments, as in a series plot.
STEP
the data points are connected using a step function, as in a step plot.
Default:SERIES

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
Band Plot Modeled to a Step Plot