Get and set color palettes

palette_getset(palette, setforggplot = TRUE)

Arguments

palette

Choose color palette

setforggplot

If TRUE (default), the color palette is set as default ggplot2.discrete.fill and ggplot2.discrete.colour.

Value

The color palette as a named vector

Examples

library(ggplot2)

p1 <- ggplot(data = PlantGrowth) +
  aes(y = weight, x = group, fill = group) +
  geom_bar(stat = "summary", fun = "mean")

p1


BioMathR::palette_getset("BioMath")
#>     green      grey    orange       red      blue 
#> "#00923f" "#495057" "#f0a202" "#e4572e" "#96c5f7" 

p1


p1 + BioMathR::theme_BioMath()