When you plot a bar chart in ggplot2, the y axis labelling automatically stops at the break below the highest value. In the graph the last label is 40, whereas I want it to round up to the next break which would be 50.
set.seed (52)
date<-data.frame(date=sample(seq(as.Date('2020-01-01'), as.Date('2020-01-31'), by="day"),1000,replace=TRUE))
ggplot(data=date)+
geom_bar(mapping=aes(x=date))
I know adding +scale_y_continuous(limits=c(0,50)) will manually make the graph at 50 but I would need to keep changing this bit of the code. Is there a way to do this dynamically within the ggplot function?
scale_y_continuous(breaks = scales::pretty_breaks(15))
in the final part of your code! – Duck