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 the axis label or the legend title |
breaks |
control the breaks in the guide. There are four possible types of input:
This parameter does not affect in any way how the data is scaled - it only affects the appearance of the legend. |
labels |
|
limits |
A character vector specifying the data range for the scale. and the default order of their display in guides. |
expand |
a numeric vector of length two, giving a multiplicative and additive constant used to expand the range of the scales so that there is a small gap between the data and the axes. The defaults are (0,0.6) for discrete scales and (0.05,0) for continuous scales. |
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 |
the name of, or actual function, used to create the
guide. 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 |