scale_fill_tanagr: Creates palette to use with ggplot2 (scale_color)

Description Usage Arguments Examples

View source: R/choose_palette_ggp.R

Description

It generates a palette by linear interpolation for scale_fill

Usage

1
scale_fill_tanagr(palette_name, discrete = TRUE, ...)

Arguments

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

Examples

 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
   )

cdanielcadena/tanagR documentation built on Aug. 22, 2020, 3:23 a.m.