Closed jrosen48 closed 7 years ago
@jrosen48 Looks like you didn't specify an aesthetic for "fill". This works for me:
mtcars %>%
select(cyl, mpg) %>%
group_by(cyl) %>%
summarise(mpg_mean = mean(mpg)) %>%
ggplot(aes(x = cyl, y = mpg_mean, fill = factor(cyl))) +
geom_col() +
scale_fill_viridis(discrete = T)
That did the trick. Oops! Thanks
Thanks for a great package!
I am trying to fill bars using
geom_col()
(which is equivalent togeom_bar(stat = "identity")
in aggplot2
bar plot with colors usingscale_fill_viridis(discrete = T)
:This does not seem to color the bars. Is there a way to use
scale_fill_viridis()
to do this?