I want my X axis text to look like:
J
a
n
not be rotated with the letters turned.
I want to keep it as a date axis. I know I could make it discrete with values of "J\na\na\n"
for instance. Perhaps I can map a vector of values like that over the axis.text.x values? It seems like there should be an easier way though.
Below will demonstrate the issue. I've rotated it 90 degrees but as shown above this is not what I want.
library(tidyverse)
library(scales)
y<- c(52014,51598,61920,58135,71242,76254,63882,64768,53526,55290,45490,35602)
months<-seq(as.Date("2018-01-01"),as.Date("2018-12-01"),"month")
dat<-as.tibble(cbind(y,months)) %>%
mutate(month=as.Date(months,origin="1970-01-01"))
ggplot(dat) +
geom_line(aes(x=month,y=y)) +
scale_x_date(breaks=date_breaks("month"),labels=date_format("%b")) +
theme(axis.text.x=element_text(angle=90))