0

I am trying to change the color or use a palette in this chart, but I don't know how to add the name palette from RColorBrewer.

#This is how I get the chart:

historic_data %>% group_by(date) %>%
  summarise(n=n(),
            comp_1 = (sales_1/total_sales)*100,
            comp_2 = (sales_2/total_sales)*100,
            comp_3 = (sales_3/total_sales)*100,
            comp_4 = (sales_4/total_sales)*100) %>% 
  gather("Company", "value", - c(date, n)) %>%
  ggplot(aes(x = date, y = value, group = Company, fill = Company)) + geom_col() +
  labs(title = "Market Share",
       x = "Date",
       y = "%")+
  theme_minimal() 
Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
  • `+ scale_fill_distiller(palette = "RdBu")` for example. – teunbrand Jan 10 '21 at 01:03
  • not exactly a dupe, yet very close (paraphrasing Camille in the linked thread:) https://stackoverflow.com/q/52277437/7941188 – tjebo Jan 10 '21 at 15:53
  • and here is the suspected duplicate: https://stackoverflow.com/q/15130497/7941188 – tjebo Jan 10 '21 at 15:55
  • Does this answer your question? [changing ggplot factor colors?](https://stackoverflow.com/questions/15130497/changing-ggplot-factor-colors) – chemdork123 Mar 30 '21 at 00:18

0 Answers0