How do I manipulate the x-axis in ggplot so that the 2020-July month corresponds(is labeled directly underneath) with the 1.4 and 2020-June month corresponds with 5.6 etc?
Here is the code:
ggplot(data, aes(x = month_end_date, y = average)) +
geom_col(alpha = 0.6) +
geom_text(aes(label = average), vjust = -0.5) +
scale_x_date(breaks = '1 month', date_labels = '%Y-%m', expand =
c(.01, .01)) +
theme_minimal() +
theme(axis.text.x = element_text(angle = 90, vjust = .4)) +
labs(fill = '', y = "")
ggplot(data, aes(x = lubridate::floor_date(data$month_end_date, unit = "months"), y = average)) + ...
– SebStahjust
to yourtheme(axis.text.x = element_text(...))
. – Ben Norris