title: Plotting a Time Series in ggplot, with lines grouped by Year
body: <p>I am trying to plot a time series with years each on different lines. Take this example:</p>
  
  <pre><code>library(ggplot2)
  library(lubridate)
  library(dplyr)
  
  df = data.frame(dt = seq(as.Date("2015/01/01"), by = "day", length.out = 1000),
       num = c(sample(1:333), sample(333:665), sample(665:998)))
  </code></pre>
  
  <p>With this sample data, I then try to plot:</p>
  
  <pre><code>ggplot(df, aes(x= format(dt, format="%m-%d"), y=num, group = as.factor(year(dt)))) 
      + geom_line()
  </code></pre>
  
  <p>This returns a warning that <code>geom_path: Each group consists of only one observation. Do you need to adjust the group aesthetic?</code>. Replacing <code>color</code> with <code>group</code> gives me something similar to what I want, but the x-axis has too many labels since its type is string.</p>
  
  <p><img src="https://i.stack.imgur.com/p5F4z.png" alt="TimeSeriesPlot"></p>
  
  <p>How would you make it so that the x-axis only displays the 1st day of each month here? Or is there a better way to plot a time series like this?</p>