The RANGEATTRMAP statement
creates an attribute map that matches colors to numeric values or
value ranges. The attribute map can be associated with a data input
column that uses color to represent response values in a graph. Attribute
maps can be useful for controlling the application of gradient color
in a graph. In addition, they enable you to map color to data values,
independent of the actual data that is used in the graph. For example,
for temperature data, you can set Blue for 0 and Red for 100, even
if the values 0 and 100 are not in the data.
Defining and using the
attribute map requires you to coordinate settings on several statements:
-
Use the RANGEATTRMAP statement
to start the attribute definition and assign a name to it.
-
Nest within the RANGEATTRMAP block
at least one
RANGE statement that specifies a numeric
value or numeric range and the color to associate with that value
or range. Use one RANGE statement for each value range that you want
to map. You can use keywords like MIN and MAX in the range specification.
For complete details about the range specifications, see the RANGE
statement.
-
Use the
RANGEATTRVAR statement to create a named association
between the defined attribute map and the input column that contains
the numeric values. The ATTRMAP= argument identifies the attribute
map and the VAR= argument identifies the input column. Use the ATTRVAR=
argument to assign a name that can be used to reference the named
association in plot statements within the template.
-
Reference the attribute variable
in one or more plot statements by specifying the name that is assigned
in the RANGEATTRVAR statement’s ATTRVAR= argument. Each plot
statement’s documentation in this reference indicates which
options support an attribute variable as the specified value.
In a CONTINUOUSLEGEND
statement, reference the plot statement that uses the attribute map.
The plot statement must have a NAME= option that assigns a name to
the plot, and then the CONTINUOUSLEGEND statement references that
name. Because the attribute map is referenced in the plot statement,
the legend uses that attribute map to represent the numeric values
that are present in the data.
The RANGEATTRMAP statement
must be located within the BEGINGRAPH block but outside of the outermost
layout block. It cannot be nested in another RANGEATTRMAP statement
or in a RANGEATTRMAP statement. The RANGEATTRMAP block must contain
at least one
RANGE statement. All values that are referenced
in the attribute map must be numeric. Data values that are not accounted
for in the attribute map receive the default color from the GraphOther,
GraphOverflow, or GraphUnderflow style element, depending on where
the unassigned values are relative to the specified data ranges.
Note: Unlike a DISCRETEATTRMAP
statement, a RANGEATTRMAP statement cannot be directly referenced
in a legend. This is because the RANGE statements can specify keywords
like MIN and MAX that require a data association for interpretation.