Hi, I'm struggling to change the colour of the bars in my bar chart. I'm trying to use the viridis colour pallette but the chart keeps coming out grey.
I'd also like to have the values of each bar labeled on the chart as percentages using geom_text but I can't work out how to do that either!
library(ggplot2) positions <- c("Yes", "No") ggplot(data = H1) + geom_bar(mapping = aes(x = Volyesno, y = ..prop.., group = 1), stat = "count") + scale_y_continuous(labels = scales::percent_format()) + xlab("Have you volunteered within the last 12 months?") + ylab("Percentage of respondents") + labs(title = "Engagement of students in volunteering over the past 12 months") + scale_x_discrete(limits = positions) + scale_fill_viridis_d(alpha = 1, begin =0, end = 1, direction = 1, option = "D", aesthetics = "fill")