Using Attribute Mapping

The attribute map feature enables you to control the visual attributes that are applied to specific data values in your graphs. For example, if a procedure creates a graph that plots items sold in different countries, you can specify the display attributes for the sales data of each country.
You can use the ODS Graphics procedures or the Graph Template Language to map visual attributes to input data values.
When using the ODS Graphics procedures, attribute maps apply only to group data. Attribute maps enable you to ensure that particular visual attributes are applied to data values in particular groups.
Two main steps are required for attribute mapping:
  1. Create an SG attribute map data set, which associates data values with particular visual attributes. Each observation defines the attributes for a data group.
  2. Modify the procedure and its plot statements to use the data in the SG attribute map. You can use attribute maps in the SGPLOT, SGPANEL, and SGSCATTER procedures (not all plot statements support attribute maps).
The Graph Template Language supports both discrete and range attribute maps.
Discrete attribute maps enable you to map discrete data to specific visual attributes (for example, color). This feature could be used to represent a data value with a specific visual attribute, regardless of the order of the values in the data. For example, when using gender as a grouping category for plots, you could set an attribute map for marker symbols.
Range attribute maps enable you to control color assignment, regardless of the current data range for a plot. This feature could be used to represent values that are not actually in the data. For example, for temperature data, you could set blue for 0 and red for 100, even if the values 0 and 100 are not in the data.