tableau_color_pal: Tableau Color Palettes (discrete)

View source: R/tableau.R

tableau_color_palR Documentation

Tableau Color Palettes (discrete)

Description

Color palettes used in Tableau.

Usage

tableau_color_pal(
  palette = "Tableau 10",
  type = c("regular", "ordered-sequential", "ordered-diverging"),
  direction = 1
)

Arguments

palette

Palette name. See Details for available palettes.

type

Type of palette. One of "regular", "ordered-diverging", or "ordered-sequential".

direction

If 1, the default, then use the original order of colors. If -1, then reverse the order.

Details

Tableau provides three types of color palettes: "regular" (discrete, qualitative categories), "ordered-sequential", and "ordered-diverging".

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

References

http://vis.stanford.edu/color-names/analyzer/

Maureen Stone, 'Designing Colors for Data' (slides), at the International Symposium on Computational Aesthetics in Graphics, Visualization, and Imaging, Banff, AB, Canada, June 22, 2007.

Heer, Jeffrey and Maureen Stone, 2012 'Color Naming Models for Color Selection, Image Editing and Palette Design', ACM Human Factors in Computing Systems (CHI) http://vis.stanford.edu/files/2012-ColorNameModels-CHI.pdf.

See Also

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

Examples

library("scales")

palettes <- ggthemes_data[["tableau"]][["color-palettes"]][["regular"]]
for (palname in names(palettes)) {
  pal <- tableau_color_pal(palname)
  max_n <- attr(pal, "max_n")
  show_col(pal(max_n))
  title(main = palname)
}

jrnold/ggthemes documentation built on Feb. 17, 2024, 7:30 a.m.