set.seed(1234)
mydata$time.remaining <- rpois(31, 5)
ggplot(mydata, aes(x=time.remaining, fill = cut(time.remaining, 6))) +
geom_histogram(binwidth=1.2, colour="black", show.legend = FALSE) +
geom_vline(aes(xintercept=mean(time.remaining, na.rm=T)), # Ignore NA values for mean
color="red", linetype="dashed", size=1) +
ggtitle("Number of Test-outs and Days Remaining") +
scale_fill_discrete(h = c(400, 120))
Bin 2 has two different colors, which I do not want. I've tried adjusting bin width, but it seems like a crapshoot. Is there any way to get consistency using (fill=cut)?.