I would like to add year below the months in x-axis I want it be same font but bigger and centered. Something like this:
Asked
Active
Viewed 33 times
0
-
Please add some relevant code producing a plot with a date scale in the appropriate range of time. – teunbrand Nov 02 '21 at 22:47
-
1There is no built in way to do this in ggplot2 analogous to how excel does it, for instance. You might look at using facets like in this answer: https://stackoverflow.com/a/36337286/6851825 or using text/annotations like this: https://stackoverflow.com/a/39718330/6851825 – Jon Spring Nov 02 '21 at 22:55
-
This is my code: onset_month_epigraph <- ggplot(onset_month_count, aes(fill=location_type, y=case_count, x=Month_Yr)) + geom_bar(position="stack", stat="identity") + labs(y="Number of incidents", x="\ Month of Start incident Period**", title="Title") + scale_x_date(date_labels = "%b-%y", date_breaks = "1 month") – donkeypeach Nov 03 '21 at 16:39