scale_colour_gradient2_tableau: Tableau diverging colour scales (continuous)

View source: R/tableau.R

scale_colour_gradient2_tableauR Documentation

Tableau diverging colour scales (continuous)

Description

Continuous color scales using the diverging color scales in Tableau. See \funclinkscale_colour_tableau for Tabaleau discrete color scales, and \funclinkscale_colour_gradient_tableau for sequential color scales.

Usage

scale_colour_gradient2_tableau(
  palette = "Orange-Blue Diverging",
  ...,
  na.value = "grey50",
  guide = "colourbar"
)

scale_fill_gradient2_tableau(
  palette = "Orange-Blue Diverging",
  ...,
  na.value = "grey50",
  guide = "colourbar"
)

scale_color_gradient2_tableau(
  palette = "Orange-Blue Diverging",
  ...,
  na.value = "grey50",
  guide = "colourbar"
)

Arguments

palette

Palette name.

"ordered-sequential"
\Sexpr[results=rd]{ggthemes:::rd_optlist(names(ggthemes::ggthemes_data$tableau[["color-palettes"]][["ordered-sequential"]]))}
"ordered-diverging"
\Sexpr[results=rd]{ggthemes:::rd_optlist(names(ggthemes::ggthemes_data$tableau[["color-palettes"]][["ordered-diverging"]]))}
...

Arguments passed to tableau_gradient_pal.

na.value

Colour to use for missing values

guide

Type of legend. Use 'colourbar' for continuous colour bar, or 'legend' for discrete colour legend.

See Also

Other colour tableau: scale_colour_gradient_tableau(), scale_colour_tableau(), tableau_color_pal(), tableau_gradient_pal()

Examples

library("ggplot2")

df <- data.frame(
  x = runif(100),
  y = runif(100),
  z1 = rnorm(100),
  z2 = abs(rnorm(100))
)
p <- ggplot(df, aes(x, y)) + geom_point(aes(colour = z2))

palettes <-
  ggthemes_data[["tableau"]][["color-palettes"]][["ordered-diverging"]]
for (palette in head(names(palettes))) {
  print(p + scale_colour_gradient2_tableau(palette) +
        ggtitle(palette))
}

# If you need to reverse a palette, use a transformation
p + scale_colour_gradient2_tableau(trans = "reverse")

ggthemes documentation built on May 29, 2024, 10:37 a.m.