Hi, does anybody know a way to bring the X axis up/down in ggplot?
One semi-solution I found is to add geom_hline (to Y=0 point) + vjust option (to move X labels).
I am looking for a way to move everything including ticks.
Thanks!
Replicable R example:
value <- rnorm(19, 5, 15)
year <- seq(2001, 2019, by = 1)
DF <- data.frame(t(rbind(value,year)))
colnames(DF) <- c("value", "year")
ggplot(DF, aes(x = year, y = value))+
geom_line(color = "red")+
geom_hline(yintercept = 0, linetype = "solid", color = "black")+
theme(axis.text.x = element_text(vjust = 35))+
scale_x_continuous(labels = function(x) paste0(x, ""), name = "year", breaks = seq(2001, 2019, by = 2), limits = c(2001, 2019))
