scale_color_td | R Documentation |
ggplot2
plotsThe scale_color_td()
and scale_fill_td()
functions provide quick access
to my frequently used palettes for ggplot2
.
scale_color_td(palette = "pastel6", type = "discrete", reverse = FALSE, ...) scale_fill_td(palette = "pastel6", type = "discrete", reverse = FALSE, ...)
palette |
Character name of palette:
|
type |
One of "discrete" (default) or "continuous". |
reverse |
Logical to reverse palette order. |
... |
Arguments passed on to
|
library(ggplot2) library(dplyr) p <- diamonds %>% filter(carat >= 2.2) %>% ggplot(aes(x = price, y = cut, fill = cut)) + geom_boxplot() + theme(legend.position = "none") p + scale_fill_td() p <- faithfuld %>% ggplot(aes(waiting, eruptions, fill = density)) + geom_tile() + scale_x_continuous(expand = c(0, 0)) + scale_y_continuous(expand = c(0, 0)) p + scale_fill_td(palette = "div5", type = "continuous")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.