The SGPLOT Procedure |
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 |
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:
Band options:
FILL | NOFILL | |
FILLATTRS= style-element | ( COLOR=color) | |
LINEATTRS= style-element <(options)> | (options) | |
MODELNAME= "plot-name" | |
NOEXTEND | |
NOMISSINGGROUP | |
OUTLINE | NOOUTLINE |
Plot options:
GROUP= variable | |
LEGENDLABEL= "text-string" | |
NAME= "text-string" | |
TRANSPARENCY= numeric-value | |
X2AXIS | |
Y2AXIS |
Required Arguments |
specifies a variable that is used to plot the band along the x or y axis.
specifies the lower value for the band. You can specify either a constant numeric value or a numeric variable.
specifies the upper value for the band. You can specify either a constant numeric value or a numeric variable.
Options |
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. |
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.
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. |
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.
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. |
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.
options can be one or more of the following:
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. |
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. |
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. |
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.
specifies a name for the plot. You can use the name to refer to this plot in other statements.
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. |
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. |
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. |
specifies the degree of transparency for the plot. Specify a value from 0.0 (completely opaque) to 1.0 (completely transparent).
Default: | 0.0 |
assigns the variables that are assigned to the primary (bottom) horizontal axis to the secondary (top) horizontal axis.
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
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.