ng_scale: Colour scale constructor for Nightingale colours

Description Usage Arguments Author(s) Examples

Description

Colour scale constructor for Nightingale colours

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
scale_colour_ng_d(..., palette = "all", reverse = FALSE, aesthetics = "colour")

scale_fill_ng_d(..., palette = "all", reverse = FALSE, aesthetics = "fill")

scale_colour_ng_c(
  ...,
  palette = "magma",
  reverse = FALSE,
  values = NULL,
  space = "Lab",
  na.value = "grey50",
  guide = "colourbar",
  aesthetics = "colour"
)

scale_fill_ng_c(
  ...,
  palette = "magma",
  reverse = FALSE,
  values = NULL,
  space = "Lab",
  na.value = "grey50",
  guide = "colourbar",
  aesthetics = "fill"
)

Arguments

...

Additional arguments passed to discrete_scale() or continuous_scale() to control name, limits, breaks, labels and so forth.

palette

Character name of the Nightingale (or viridis) colour palette.

reverse

Boolean indicating whether the palette should be reversed.

aesthetics

Character string or vector of character strings listing the name(s) of the aesthetic(s) that this scale works with. This can be useful, for example, to apply colour settings to the 'colour' and 'fill' aesthetics at the same time, via 'aesthetics = c("colour", "fill")'.

values

if colours should not be evenly positioned along the gradient this vector gives the position (between 0 and 1) for each colour in the colours vector. See rescale() for a convenience function to map an arbitrary range to between 0 and 1.

space

colour space in which to calculate gradient. Must be "Lab" - other values are deprecated.

na.value

Missing values will be replaced with this value.

guide

A function used to create a guide or its name. See guides() for more info.

Author(s)

Ilari Scheinin

Examples

1
2
3
4
5
6
# Example taken from ggplot2::scale_colour_discrete()
dsamp <- ggplot2::diamonds[sample(nrow(ggplot2::diamonds), 1000), ]
d <- ggplot2::ggplot(dsamp, ggplot2::aes(carat, price)) +
  ggplot2::geom_point(ggplot2::aes(colour = clarity)) +
  ggforestplot::scale_colour_ng_d()
print(d)

NightingaleHealth/ggforestplot documentation built on April 10, 2020, 7:01 p.m.