discrete_scale {ggplot2} | R Documentation |
Discrete scale constructor.
discrete_scale(aesthetics, scale_name, palette, name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, expand = waiver(), na.translate = TRUE, na.value = NA, drop = TRUE, guide = "legend", position = "left", super = ScaleDiscrete)
aesthetics |
The names of the aesthetics that this scale works with |
scale_name |
The name of the scale |
palette |
A palette function that when called with a single integer argument (the number of levels in the scale) returns the values that they should take |
name |
The name of the scale. Used as axis or legend title. If
|
breaks |
One of:
|
labels |
One of:
|
limits |
A character vector that defines possible values of the scale and their order. |
expand |
Vector of range expansion constants used to add some
padding around the data, to ensure that they are placed some distance
away from the axes. Use the convenience function |
na.translate |
Unlike continuous scales, discrete scales can easily show
missing values, and do so by default. If you want to remove missing values
from a discrete scale, specify |
na.value |
If |
drop |
Should unused factor levels be omitted from the scale?
The default, |
guide |
A function used to create a guide or its name. See
|
position |
The position of the axis. "left" or "right" for vertical scales, "top" or "bottom" for horizontal scales |
super |
The super class to use for the constructed scale |