Discrete zodiac colors
scale_fill_zodiac(..., use_factor_order = FALSE)
... | Extra parameters to pass to |
---|---|
use_factor_order | A logical. If |
library(dplyr) library(ggplot2) ## Use colors that match with each zodiac sign p <- sample_dates %>% ## Sample 100 dates from 2020 to count sample_n(100) %>% mutate(zodiac_sign = zodiac_sign(date)) %>% ggplot() + aes( x = zodiac_sign, fill = zodiac_sign ) + geom_bar() + ## Set use_factor_order = TRUE scale_fill_zodiac(use_factor_order = TRUE) ## Use the colors in the palette without zodiac signs p2 <- iris %>% ggplot() + aes( x = Species, fill = Species ) + geom_bar() + scale_fill_zodiac()