Ggplot adds ticks marks centrally using this code:
tibble(year = 2010:2020, count = sample(1:100, 11)) %>%
mutate(year = paste0("01/01/", year)) %>%
mutate(year = dmy(year)) %>%
ggplot +
geom_bar(aes(year, count), stat = "identity", width = 240, position = position_dodge(width = 0.1)) +
scale_x_date(date_labels = "%y", date_breaks = "1 year") +
scale_y_continuous(limits = c(0,100), expand = c(0, 0)) +
theme_classic()
But I need tick marks either side of the year. I have photoshopped in the tick marks plot to show where I need them. What code can I use to add ticks marks either side of year?


