I have a simple bar graph in ggplot2. I am using the "grey" scale for my bars; the default order is darkest to lightest from left to right. Here's what my code looks like:
ggplot.3plus<-ggplot(summary.3plus, aes(x=sp1, y=fract.mean, fill=age.cat)) +
geom_bar(position=position_dodge())+ coord_cartesian(ylim = c(1, 1.175))+
geom_errorbar(aes(ymin=fract.mean-se, ymax=fract.mean+se),
width=.2, # Width of the error bars
position=position_dodge(.9))
ggplot.3plus<-ggplot.3plus+scale_fill_grey()
I would like to change the color order of the greys to lightest to darkest from left to right, while keeping the bars themselves in the same order. The code I'm using to reverse the order of the color ramp doesn't seem to be working.
It would be easier with a reproducible example, but what about:
y + scale_fill_grey(start=0.8, end=0.2)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With