| TEMPLATE Procedure: Plot Statements (Experimental) |
| SCATTERPLOTMATRIX column-list < / option(s)> ; |
| Usage Information |
Scatter Plot Matrix
![[Scatter Plot Matrix]](./images/scatterplotmatrix.gif)
| Default: |
A symmetric scatter plot matrix. For n number of columns, the SCATTERPLOTMATRIX statement produces a n columns by n rows matrix of scatter plots. |
| Restriction: |
Do not use the SCATTERPLOTMATRIX statement inside of a LAYOUT OVERLAY block. The SCATTERPLOTMATRIX statement generates its own matrix of plots. |
| Interaction: |
You can use a SCATTERPLOTMATRIX statement with the ROWVARS= option specified to produce a rectangular matrix of scatter plots. For an example using the SCATTERPLOTMATRIX statement with the ROWVARS= option see Using the ROWVARS= Option. |
| Tip: |
Limit the number of columns to seven in each dimension of the matrix so that the resulting graphs will not be too small to be useful. |
| Tip: |
The graph size is not automatically adjusted to accommodate a large number of columns. You can use the WIDTH= and HEIGHT= options on your LAYOUT statement to increase the size of the graph as needed. |
| Tip: |
If there are missing values in a column or a row, then all of the points that can be plotted are plotted in each scatter plot. |
| Required Arguments |
specifies a list of columns to plot.
| Requirement: | There must be at least three columns to produce a useful matrix. |
| 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. |
| DATALABEL=column | Specifies the labels of the markers. |
| DATALABELCOLOR= color | style-reference | Specifies the color of the marker labels. |
| DATALABELFONTFAMILY= 'string' | style-reference | Specifies the font family of the marker labels. |
| DATALABELFONTSIZE=dimension | style-reference | Specifies the font size of the marker labels. |
| DATALABELFONTSTYLE= NORMAL | ITALIC | style-reference | Specifies the font style of the marker labels. |
| DATALABELFONTWEIGHT= NORMAL | BOLD | style-reference | Specifies the font weight of the marker labels. |
| DATALABELFORMAT=format | Specifies the format of the marker labels. |
| DATATRANSPARENCY= number | Specifies the degree of the transparency of the markers. |
| DIAGONAL= (graph(s)) | Specifies one or more normal, histogram, or kernel graphs in the diagonal cells of the plot matrix. |
| GRIDTRANSPARENCY=number | Specifies the degree of the transparency of the grid lines. |
| GROUP =column | Creates a separate scatter plot matrix for each unique group value of the specified column. |
| INDEX=integer-column | Specifies indices for remapping the assignment of the color and the marker symbols to group values. |
| MARKERCOLOR= color | style-reference | GRADIENT | Specifies the color of the observation markers. |
| MARKERCOLORGROUP= numeric-column | Specifies the column that is used to map the marker colors. |
| MARKERS= boolean | Specifies whether observation markers are displayed. |
| MARKERSIZE= dimension | style-reference | Specifies the marker width. The marker width is equal to the marker height. |
| MARKERSYMBOL= marker | CHARACTER | Specifies the marker symbol of the observation markers. |
| MARKERSYMBOLGROUP= column | Specifies the column that is used to map the marker symbols. |
| NAME= 'string' | Assigns a name to a plot statement for reference in other template statements. |
| ROWVARS = (column-list) | Specifies a secondary list of columns to be paired with the required column list that is specified by the SCATTERPLOTMATRIX statement. |
| TIP= column-list | Specifies the information to display when the cursor is positioned over a graph element. |
| TRANSPARENCY =number | Specifies the degree of the transparency of the background, markers, grid, axis features, and wall, if displayed in a graph. |
| WALLTRANSPARENCY= number | Specifies the degree of the transparency of the plot wall. |
| XERRORLOWER= numeric-column | Specifies the values for the lower endpoints on the X error bars. |
| XERRORUPPER= numeric-column | Specifies the values for upper endpoints on the X error bars. |
| XGRID= boolean | Specifies whether the grid lines are drawn at the tick marks. |
| XMAX= number | Specifies the maximum X data value to use in the display of the data. |
| XMIN= number | Specifies the minimum X data value to use in the display of the data. |
| YERRORLOWER =numeric-column | Specifies the values for the lower endpoints on the Y error bars. |
| YERRORUPPER=numeric-column | Specifies the values for the upper endpoints on the Y error bars. |
| YGRID= boolean | Specifies whether grid lines are drawn at the tick marks. |
| YMAX= number | Specifies the maximum Y data value to use in the display of data. |
| YMIN= number | Specifies the minimum Y data value to use in the display of data. |
specifies the background color of the graph.
| Default: | Specified by the GraphBackground:Background style reference. |
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. |
| See also: | TRANSPARENCY= option |
specifies the labels of the markers.
| Default: | No labels are displayed. |
| Tip: | The position of the labels are adjusted to prevent the labels from overlapping. |
specifies the color of the marker labels.
| Default: | Specified by the GraphDataDefault:ContrastColor style reference. |
| Interaction: | The DATALABELCOLOR= option overrides the GROUP= option. |
| Tip: | When the GROUP= option is used, each distinct group value is represented by a different color. The data label that is associated with the group is assigned the group color. The DATALABELCOLOR= option can be used to specify a single color for all data labels in a graph, without affecting items that have the group color, such as lines and marker symbols. |
specifies the font family of the marker labels.
| Default: | Specified by the GraphDataText:Font_Face style reference. |
| Restriction: | You must specify one font family name. You cannot specify a list of font family names. |
specifies the font size of the marker labels.
| Default: | Specified by the GraphDataText:Font_Size style reference. |
specifies the font style of the marker labels.
| Default: | Specified by the GraphDataText:Font_Style style reference. |
specifies the font weight of the marker labels.
| Default: | Specified by the GraphDataText:Font_Weight style reference. |
specifies the format of the marker labels.
| Default: | The format of the column. For an unformatted numeric column, the data label uses the BEST12 format. |
| Restriction: | The w.d format must be specified using the Fw.d format. |
specifies the degree of the transparency of the markers.
| Default: | 0 |
| Range: | 0 (opaque) to 1 (entirely transparent) |
| Interaction: | The DATATRANSPARENCY= option overrides the TRANSPARENCY= option for the markers. |
| See also: | TRANSPARENCY= option |
displays one or more of the following graphs in the diagonal cells of the plot matrix:
| HISTOGRAM |
specifies a histogram. |
| NORMAL |
specifies a normal density curve. |
| KERNEL |
specifies a kernel density estimate. |
specifies the degree of the transparency of the grid lines.
| Default: | 0 |
| Range: | 0 (opaque) to 1 (entirely transparent) |
| Interaction: | The GRIDTRANSPARENCY= option overrides the TRANSPARENCY= option for the grid lines. |
| See also: | TRANSPARENCY= option |
creates a separate scatter plot matrix for each unique group value of the specified column.
| Default: | Each distinct group value is represented in the graph by a different combination of color and marker symbol. |
| Tip: | If error bars are displayed, then the bars are assigned the color and the 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 marker symbol, but the MARKERSYMBOL= option could be used to assign the same symbol to all of the plot's marker symbols. |
specifies indices for remapping the assignment of the color and the marker symbols to group values.
| Interaction: | The INDEX= option must be used with the GROUP= option. If the GROUP= option is not specified, the INDEX= option is ignored. |
| Restriction: | If the INDEX= option is not used, then the group values are mapped in the order of the data. |
| Main discussion: | Remapping the Color and Marker Symbols by Using the INDEX= option |
specifies the colors of the observation markers.
| Default: | Specified by the GraphDataDefault style element. |
| Restriction: | If the GRADIENT value is specified, then the MARKERCOLORGROUP= option must also be used. Colors are specified by the ThreeColorAltRamp style element. |
| Interaction: | The MARKERCOLOR= option overrides the GROUP= option and the marker symbol is used to distinguish the groups. |
specifies the column that is used to map marker colors.
| Restriction: | The MARKERCOLORGROUP= option is ignored unless MARKERCOLOR=GRADIENT. |
| Tip: | The MARKERCOLORGROUP= option can be used to add a second response variable to an analysis. For example, in an analysis of weight by height, an age column might be specified by the MARKERCOLORGROUP= option so that the change in the gradient color of the markers reflects the change in age of the subjects in the study. |
specifies whether observation markers are displayed.
| Default: | TRUE |
specifies the marker width. The marker width is equal to the marker height.
| Default: | 10px |
specifies the marker symbol of the observation markers.
The CHARACTER value specifies that the marker is composed of the leading characters of the values specified in the GROUP= option or in the MARKERSYMBOLGROUP= option.
| Default: | Specified by the GraphDataDefault:MarkerSymbol style reference. If the GROUP= option is specified, then the markers are selected from the STANDARD marker set. |
| Requirement: | If the CHARACTER value is specified, then the MARKERSYMBOLGROUP= option must be specified. |
| Interaction: | If CHARACTER is specified for the MARKERSYMBOL= option , then the marker symbol is composed of all the characters from the values specified by the MARKERSYMBOLGROUP= option. |
| Interaction: | The MARKERSYMBOL= option overrides GROUP= option and the marker color is used to distinguish the groups. |
| Tip: | The data values are centered around the marker positions in both the X and Y directions. The positions are not adjusted to prevent overlap. |
specifies the column that is used to map the marker symbols.
| Interaction: | The MARKERSYMBOLGROUP= option is ignored unless MARKERSYMBOL=CHARACTER. |
| Tip: | The MARKERSYMBOLGROUP= option is useful for specifying data values as the marker symbols in a graph. |
| See: | MARKERSYMBOL |
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. |
specifies a secondary list of columns to be paired with the required column list that is specified by the SCATTERPLOTMATRIX statement.
| Interaction: | When the ROWVARS= option is specified, the DIAGONAL= option is ignored. |
| Tip: | The labels for the variables appear vertically on the left side of the matrix. |
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. |
specifies the degree of the transparency of the background, markers, grid, axis features, and wall, if displayed in a graph.
| Default: | 0 |
| Range: | 0 (opaque) to 1 (entirely transparent) |
| Interaction: | You can specify the transparency of individual graph elements by using the BACKTRANSPARENCY=, DATATRANSPARENCY=, GRIDTRANSPARENCY=, and WALLTRANSPARENCY= options. The value specified by the TRANSPARENCY= option is only applied to the transparencies that you do not specify individually. |
specifies the degree of the transparency of the plot wall.
| Default: | 0 |
| Range: | 0 (opaque) to 1 (entirely transparent) |
| Interaction: | The WALLTRANSPARENCY= option overrides the TRANSPARENCY= option for the graph wall. |
| See also: | TRANSPARENCY= option |
specifies the values for the lower endpoints on the X error bars.
| Default: | The lower segment of the error bars is not drawn. |
| Restriction: | The error bar color cannot be changed. |
| Tip: | The values are actual values, not relative values. |
specifies the values for the upper endpoints on the X error bars.
| Default: | The upper segment of the error bars is not drawn. |
| Restriction: | The error bar color cannot be changed. |
| Tip: | The values are actual values, not relative values. |
specifies whether the grid lines are drawn at the tick marks.
| Default: | FALSE | ||||||
| Interaction: |
Default characteristics for the
grid lines are specified from the following attributes on the GraphGridLines
style element:
|
specifies the maximum X data value to use in the display of the data.
| Default: | The maximum X value in the data. |
| Restriction: | If the data contains values greater than the number that is specified for the XMAX= option, then the values are excluded from the plot. |
| TIP: | The value specified by the XMAX= option is applied to all of the columns that are in the matrix. These values should be used with variables that have a similar scale. |
specifies the minimum X data value to use in the display of the data.
| Default: | The 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 values are excluded from the plot. |
| TIP: | The value specified by the XMIN= option is applied to all of the columns that are in the matrix. These values should be used with variables that have a similar scale. |
specifies the values for the lower endpoints on the Y error bars.
| Default: | The lower segment of the error bars is not drawn |
| Restriction: | The error bar color cannot be changed. |
| Tip: | The values are actual values, not relative values. |
specifies the values for the upper endpoints on the Y error bars.
| Default: | The upper segment of the error bars is not drawn |
| Restriction: | The error bar color cannot be changed. |
| Tip: | The values are actual values, not relative values. |
specifies whether grid lines are drawn at the tick marks.
| Default: | FALSE | ||||||
| Interaction: |
Default characteristics for the
grid lines are specified from the following attributes on the GraphGridLines
style element:
|
specifies the maximum Y data value to use in the display of the data.
| Default: | The maximum Y value in the data. |
| Restriction: | If the data contains values that are greater than the number specified for the YMAX= option, then the values are excluded from the plot. |
| TIP: | The value specified by the YMAX= option is applied to all of the columns that are in the matrix. These values should be used with variables that have a similar scale. |
specifies the minimum Y data value to use in the display of data.
| Default: | The 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 values are excluded from the plot. |
| TIP: | The value specified by the YMIN= option is applied to all of the columns that are in the matrix. These values should be used with variables that have a similar scale. |
| Using the ROWVARS= Option |
Specifying n number of columns with the SCATTERPLOTMATRIX statement and m number of columns with the ROWVARS= option produces an n columns by m rows matrix of scatter plots.
The following statements produces the 3 rows by 2 columns matrix shown in the figure below.
SCATTERPLOTMATRIX Height Weight / ROWVARS=(Age Height Weight);
3 Rows by 2 Columns Matrix
![[3 Rows by 2 Columns Matrix]](./images/scattermatrix.gif)