77# ' functions that assign discrete color bins to the continuous values
88# ' instead of using a continuous color spectrum.
99# '
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.
2517# '
2618# ' These scale functions are meant to provide simple defaults. If
2719# ' you want to manually set the colors of a scale, consider using
3527# ' * a palette function that when called with a numeric vector with values
3628# ' between 0 and 1 returns the corresponding output values.
3729# ' @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:
3931# ' * "gradient" (the default)
4032# ' * "viridis"
4133# ' * A function that returns a continuous colour scale.
@@ -173,9 +165,7 @@ scale_fill_binned <- function(..., palette = NULL, aesthetics = "fill", guide =
173165
174166# ' Discrete colour scales
175167# '
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.
179169# '
180170# ' @param palette One of the following:
181171# ' * `NULL` for the default palette stored in the theme.
@@ -185,7 +175,9 @@ scale_fill_binned <- function(..., palette = NULL, aesthetics = "fill", guide =
185175# ' number of levels in the scale) returns the values that they should take.
186176# ' @param ... Additional parameters passed on to the scale type,
187177# ' @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:
189181# ' * A character vector of color codes. The codes are used for a 'manual' color
190182# ' scale as long as the number of codes exceeds the number of data levels
191183# ' (if there are more levels than codes, [scale_colour_hue()]/[scale_fill_hue()]
0 commit comments