discrete_scale {ggplot2} | R Documentation |
Discrete scale constructor
Description
Discrete scale constructor
Usage
discrete_scale(
aesthetics,
scale_name = deprecated(),
palette,
name = waiver(),
breaks = waiver(),
labels = waiver(),
limits = NULL,
expand = waiver(),
na.translate = TRUE,
na.value = NA,
drop = TRUE,
guide = "legend",
position = "left",
call = caller_call(),
super = ScaleDiscrete
)
Arguments
aesthetics |
The names of the aesthetics that this scale works with. |
scale_name |
The name of the scale that should be used for error messages associated with this 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 (e.g., |
name |
The name of the scale. Used as the axis or legend title. If
|
breaks |
One of:
|
labels |
One of:
|
limits |
One of:
|
expand |
For position scales, a 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 |
For position scales, The position of the axis.
|
call |
The |
super |
The super class to use for the constructed scale |
See Also
The new scales section of the online ggplot2 book.