7
7
# ' functions that assign discrete color bins to the continuous values
8
8
# ' instead of using a continuous color spectrum.
9
9
# '
10
- # ' All these colour scales use the [options()] mechanism to determine
11
- # ' default settings. Continuous colour scales default to the values of the
12
- # ' `ggplot2.continuous.colour` and `ggplot2.continuous.fill` options, and
13
- # ' binned colour scales default to the values of the `ggplot2.binned.colour`
14
- # ' and `ggplot2.binned.fill` options. These option values default to
15
- # ' `"gradient"`, which means that the scale functions actually used are
16
- # ' [scale_colour_gradient()]/[scale_fill_gradient()] for continuous scales and
17
- # ' [scale_colour_steps()]/[scale_fill_steps()] for binned scales.
18
- # ' Alternative option values are `"viridis"` or a different scale function.
19
- # ' See description of the `type` argument for details.
20
- # '
21
- # ' Note that the binned colour scales will use the settings of
22
- # ' `ggplot2.continuous.colour` and `ggplot2.continuous.fill` as fallback,
23
- # ' respectively, if `ggplot2.binned.colour` or `ggplot2.binned.fill` are
24
- # ' not set.
10
+ # ' `r lifecycle::badge("superseded")`: The mechanism of setting defaults via
11
+ # ' [options()] is superseded by theme settings. The preferred method to change
12
+ # ' the default palette of scales is via the theme, for example:
13
+ # ' `theme(palette.colour.continuous = scales::pal_viridis())`. The
14
+ # ' `ggplot2.continuous.colour` and `ggplot2.continuous.fill` options could be
15
+ # ' used to set default continuous scales and `ggplot2.binned.colour` and
16
+ # ' `ggplot2.binned.fill` options to set default binned scales.
25
17
# '
26
18
# ' These scale functions are meant to provide simple defaults. If
27
19
# ' you want to manually set the colors of a scale, consider using
35
27
# ' * a palette function that when called with a numeric vector with values
36
28
# ' between 0 and 1 returns the corresponding output values.
37
29
# ' @param ... Additional parameters passed on to the scale type
38
- # ' @param type One of the following:
30
+ # ' @param type `r lifecycle::badge("superseded")` One of the following:
39
31
# ' * "gradient" (the default)
40
32
# ' * "viridis"
41
33
# ' * A function that returns a continuous colour scale.
@@ -173,9 +165,7 @@ scale_fill_binned <- function(..., palette = NULL, aesthetics = "fill", guide =
173
165
174
166
# ' Discrete colour scales
175
167
# '
176
- # ' The default discrete colour scale. Defaults to [scale_fill_hue()]/[scale_fill_brewer()]
177
- # ' unless `type` (which defaults to the `ggplot2.discrete.fill`/`ggplot2.discrete.colour` options)
178
- # ' is specified.
168
+ # ' The default discrete colour scale.
179
169
# '
180
170
# ' @param palette One of the following:
181
171
# ' * `NULL` for the default palette stored in the theme.
@@ -185,7 +175,9 @@ scale_fill_binned <- function(..., palette = NULL, aesthetics = "fill", guide =
185
175
# ' number of levels in the scale) returns the values that they should take.
186
176
# ' @param ... Additional parameters passed on to the scale type,
187
177
# ' @inheritParams discrete_scale
188
- # ' @param type One of the following:
178
+ # ' @param type `r lifecycle::badge("superseded")` The preferred mechanism for
179
+ # ' setting the default palette is by using the theme. For example:
180
+ # ' `theme(palette.colour.discrete = "Okabe-Ito")`. One of the following:
189
181
# ' * A character vector of color codes. The codes are used for a 'manual' color
190
182
# ' scale as long as the number of codes exceeds the number of data levels
191
183
# ' (if there are more levels than codes, [scale_colour_hue()]/[scale_fill_hue()]
0 commit comments