Consider the following example:
library(ggplot2) library(lubridate) set.seed(4) date <- seq(from = as.POSIXct("2012-01-01"), to = as.POSIXct("2014-12-31"), by = "days") value <- c(rnorm(274, 50, 1), rnorm(274, 55, 1), rnorm(274, 55, 2), rnorm(274, 60, 2)) df <- data.frame(date, value) head(df)
What generates this graph:

What are some ways to make an axis formatted as date by month? I am trying to define a clean way to use both lubridate and scale_x_date , if possible?
Perhaps there are better ways to create this type of graph? That is, creating factors over the years and laying them on top of each other? (NOTE: I do not want to use facet_wrap or facet_grid for this example).
source share