82  Encoding Categorical Variables

The visual encoding of categorical variables is very flexible since these variables are likely to be qualitative (representing a group) rather than quantitative (representing an actual value on a scale). In general the choice will depend on what is being encoded.

Sequential colours are preferred for ordered variables, since there is an inherent ordering to the categories.

Shape outlines are ideal for dense data sets (preferentially open circles

Filled shapes are suitable if there is no over-plotting or if alpha-blending is used (see page Alpha-blending).

Direct labels can be combined with the other elements to highlight specific data points (see direct line labeling in figure irrigation-good.

Hatching and colours can be used to distinguish groups in bar and box plots but are not as salient as colors.

Figure 82.1: Elements for encoding categorical variables.