cat Scale (GPL)

Syntax

cat(dim(<numeric>), <function>)

or

cat(aesthetic(aesthetic.<aesthetic type>), <function>)

<numeric>. A numeric value indicating the dimension to which the scale applies. See the topic dim Function (GPL) for more information.

<function>. One or more valid functions. These are optional.

<aesthetic type>. An aesthetic type indicating the aesthetic to which the scale applies. This is an aesthetic created as the result of an aesthetic function in the ELEMENT statement, often used for distinguishing groups of graphic elements, as in clusters and stacks.

Description

Creates a categorical scale that can be associated with a dimension (such as an axis or panel facet) or an aesthetic (as in the legend). A categorical scale is created for a categorical variable by default. You usually don't need to specify the scale unless you want to use a function to modify it (for example, to sort the categories).

Examples

Figure 1. Example: Specifying the scale for a dimension and sorting categories
SCALE: cat(dim(1), sort.natural())
Figure 2. Example: Specifying the scale for an aesthetic and including categories
SCALE: cat(aesthetic(aesthetic.color), include("IL"))

Note: The exclude function is not supported for aesthetic scales.