Automatically selected when a positional aesthetic maps to character, factor, or logical data; construct explicitly via scale_x_discrete() / scale_y_discrete() to fix the level order.

ScaleDiscrete(aesthetic = "x", limits = NULL, name = NULL)

Arguments

aesthetic

"x" or "y".

limits

Optional character vector fixing the levels (and their order); NULL trains levels from the data.

name

Optional axis title.

The levels property (the trained categories) is filled in during the plot build, not at construction.

Value

An S7 object of class ScaleDiscrete; usually built by scale_x_discrete() rather than called directly.