Debian Codegraph @

man/scale_colour_discrete_qualitative.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/scale_qualitative.R
3 \name{scale_colour_discrete_qualitative}
4 \alias{scale_colour_discrete_qualitative}
5 \alias{scale_color_discrete_qualitative}
6 \alias{scale_fill_discrete_qualitative}
7 \title{HCL-Based Discrete Qualitative Color Scales for ggplot2}
8 \usage{
9 scale_colour_discrete_qualitative(
10 palette = NULL,
11 c1 = NULL,
12 l1 = NULL,
13 h1 = NULL,
14 h2 = NULL,
15 alpha = 1,
16 rev = FALSE,
17 nmax = NULL,
18 order = NULL,
19 aesthetics = "colour",
20 ...
21 )
22
23 scale_color_discrete_qualitative(
24 palette = NULL,
25 c1 = NULL,
26 l1 = NULL,
27 h1 = NULL,
28 h2 = NULL,
29 alpha = 1,
30 rev = FALSE,
31 nmax = NULL,
32 order = NULL,
33 aesthetics = "colour",
34 ...
35 )
36
37 scale_fill_discrete_qualitative(..., aesthetics = "fill")
38 }
39 \arguments{
40 \item{palette}{The name of the palette to be used. Run \code{hcl_palettes(type = "qualitative")} for available options.}
41
42 \item{c1}{Chroma value, used for all colors in the scale.}
43
44 \item{l1}{Luminance value, used for all colors in the scale.}
45
46 \item{h1}{Beginning hue value.}
47
48 \item{h2}{Ending hue value.}
49
50 \item{alpha}{Numeric vector of values in the range \code{[0, 1]} for alpha transparency channel (0 means transparent and 1 means opaque).}
51
52 \item{rev}{If \code{TRUE}, reverses the order of the colors in the color scale.}
53
54 \item{nmax}{Maximum number of different colors the palette should contain. If not provided, is calculated automatically
55 from the data.}
56
57 \item{order}{Numeric vector listing the order in which the colors should be used. Default is \code{1:nmax}.}
58
59 \item{aesthetics}{The ggplot2 aesthetics to which this scale should be applied.}
60
61 \item{...}{common discrete scale parameters: \code{name}, \code{breaks}, \code{labels}, \code{na.value}, \code{limits} and \code{guide}. See
62 \code{\link[ggplot2]{discrete_scale}} for more details.}
63 }
64 \description{
65 Discrete ggplot2 color scales using the color palettes generated by \code{\link{qualitative_hcl}}.
66 }
67 \details{
68 If both a valid palette name and palette parameters are provided then the provided palette parameters overwrite the parameters in the
69 named palette. This enables easy customization of named palettes.
70 }
71 \examples{
72 library("ggplot2")
73
74 # default colors
75 ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
76 geom_point() + theme_minimal() +
77 scale_color_discrete_qualitative()
78
79 # color scale "Harmonic"
80 ggplot(iris, aes(Sepal.Length, fill = Species)) +
81 geom_density(alpha = 0.7) + scale_fill_discrete_qualitative(palette = "Harmonic")
82 }