Closed
Description
Otherwise when you adjust the number of breaks, you can end up with breaks right on the margin of the plot
library(ggplot2)
may01 <- as.POSIXct("2020-05-01")
df <- data.frame(x = c(may01, may01 + 60 * 86400))
ggplot(df, aes(x, 1)) +
geom_blank() +
scale_x_datetime(NULL, date_breaks = "7 days", date_labels = "%d %b") +
scale_y_continuous(NULL, breaks = NULL)
Created on 2019-10-27 by the reprex package (v0.3.0)