scale_colour_tableau | R Documentation |
Categorical (qualitative) color scales used in Tableau. Use the function \funclinkscale_colour_gradient_tableau for the sequential and \funclinkscale_colour_gradient2_tableau for the diverging continuous color scales from Tableu.
scale_colour_tableau(
palette = "Tableau 10",
type = "regular",
direction = 1,
...
)
scale_fill_tableau(
palette = "Tableau 10",
type = "regular",
direction = 1,
...
)
scale_color_tableau(
palette = "Tableau 10",
type = "regular",
direction = 1,
...
)
palette |
Palette name. See \funclinktableau_color_pal for available palettes. |
type |
Palette type. One of |
direction |
If 1, the default, then use the original order of colors. If -1, then reverse the order. |
... |
Other arguments passed on to \funclinkdiscrete_scale. |
tableau_color_pal()
for references.
Other colour tableau:
scale_colour_gradient2_tableau()
,
scale_colour_gradient_tableau()
,
tableau_color_pal()
,
tableau_gradient_pal()
library("ggplot2")
p <- ggplot(mtcars) +
geom_point(aes(x = wt, y = mpg, colour = factor(gear))) +
facet_wrap(~am) +
theme_igray()
palettes <- ggthemes_data[["tableau"]][["color-palettes"]][["regular"]]
for (palette in head(names(palettes), 3L)) {
print(p + scale_colour_tableau(palette) +
ggtitle(palette))
}
# the order of colour can be reversed
p + scale_color_tableau(direction = -1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.