I am trying to create a line graph in ggplot2 that has tick marks that crosses the axis, rather than just inside or outside of it.
My current code is:
library(ggplot2)
data("economics", package = "ggplot2")
ggplot(economics, aes(x = date, y = uempmed)) +
geom_line() +
scale_x_date(breaks = seq.Date(from = as.Date("1968-12-31"), to = as.Date("1978-12-31"), by = "12 months"),
limits = as.Date(c("1968-01-01", "1978-12-31")), labels = scales::date_format("%y")) +
scale_y_continuous(limits = c(4,10)) +
theme_bw()
This gives me the following result:
I can get the ticks to be inside or outside when creating my own theme, but not both simultaneously.