scale_color_ft: Color scale constructor for FT colors

Description Usage Arguments See Also Examples

View source: R/gg-scales.R

Description

Color scale constructor for FT colors

Usage

1
2
scale_color_ft(palette = "main", discrete = TRUE, reverse = FALSE,
  ...)

Arguments

palette

Character name of a palette

discrete

Boolean indicating whether color aesthetic is discrete or not

reverse

Boolean indicating whether the palette should be reversed

...

Additional arguments passed to discrete_scale() or scale_color_gradientn()

See Also

scale_fill_ft

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
df <- data.frame(
 x = runif(50),
 y = runif(50),
 z = rnorm(50),
 category = letters[1 + rbinom(50, 3, .25)]
 )

library(ggplot2)
# plot with discrete color scale
ggplot(df) +
  geom_point(aes(x, y, color = category)) +
  scale_color_ft()

# plot with continuous color scale
ggplot(df) +
  geom_point(aes(x, y, color = z)) +
  scale_color_ft(palette = "claret", discrete = FALSE)

Financial-Times/ftplottools documentation built on Nov. 8, 2021, 5:11 p.m.