Description Usage Arguments Examples
View source: R/choose_palette_ggp.R
It generates a palette by linear interpolation for scale_fill
1 | scale_fill_tanagr(palette_name, discrete = TRUE, ...)
|
palette_name |
the name of the palette |
discrete |
whether to use a discrete or continuous color palette (boolean) |
... |
additional arguments to pass to scale_fill_gradientn |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | library(ggplot2)
ggplot(mpg, aes(fl, fill = fl)) +
geom_bar() +
theme(axis.text.x = element_text(hjust = 1), panel.background = element_blank()) +
scale_fill_tanagr(palette = "stilpnia_preciosa", guide = "none")
library(gridExtra)
g = ggplot(faithfuld, aes(waiting, eruptions)) +
geom_raster(aes(fill = density)) +
theme_bw() +
theme(panel.grid=element_blank())
grid.arrange(
g + scale_fill_tanagr(palette = "cyanerpes_cyaneus", guide = "none", discrete = FALSE),
g + scale_fill_tanagr(palette = "dacnis_berlepschi", guide = "none", discrete = FALSE),
g + scale_fill_tanagr(palette = "ramphocelus_sanguinolentus", guide = "none", discrete = FALSE),
g + scale_fill_tanagr(palette = "tangara_seledon", guide = "none", discrete = FALSE),
ncol = 2, nrow = 2
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.