View source: R/scale_qualitative.R
scale_colour_discrete_qualitative | R Documentation |
Discrete ggplot2 color scales using the color palettes generated by qualitative_hcl
.
scale_colour_discrete_qualitative(
palette = NULL,
c1 = NULL,
l1 = NULL,
h1 = NULL,
h2 = NULL,
alpha = 1,
rev = FALSE,
nmax = NULL,
order = NULL,
aesthetics = "colour",
...
)
scale_color_discrete_qualitative(
palette = NULL,
c1 = NULL,
l1 = NULL,
h1 = NULL,
h2 = NULL,
alpha = 1,
rev = FALSE,
nmax = NULL,
order = NULL,
aesthetics = "colour",
...
)
scale_fill_discrete_qualitative(..., aesthetics = "fill")
palette |
The name of the palette to be used. Run |
c1 |
Chroma value, used for all colors in the scale. |
l1 |
Luminance value, used for all colors in the scale. |
h1 |
Beginning hue value. |
h2 |
Ending hue value. |
alpha |
Numeric vector of values in the range |
rev |
If |
nmax |
Maximum number of different colors the palette should contain. If not provided, is calculated automatically from the data. |
order |
Numeric vector listing the order in which the colors should be used. Default is |
aesthetics |
The ggplot2 aesthetics to which this scale should be applied. |
... |
common discrete scale parameters: |
If both a valid palette name and palette parameters are provided then the provided palette parameters overwrite the parameters in the named palette. This enables easy customization of named palettes.
library("ggplot2")
# default colors
ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
geom_point() + theme_minimal() +
scale_color_discrete_qualitative()
# color scale "Harmonic"
ggplot(iris, aes(Sepal.Length, fill = Species)) +
geom_density(alpha = 0.7) + scale_fill_discrete_qualitative(palette = "Harmonic")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.