title: ggplot2 annotation with dates in x-axis
body: <p>I'm trying to draw an area plot with a series of % value, one for each day during a set period. I would like to add a segment to the top of the plot to show more clearly the areas where the % is decreasing.</p>
  
  <p>I tried to use this code (the example has just a few data points for simplicity):</p>
  
  <pre><code>library(ggplot2)
  library(scales)
  limit = c(0.85,0.87,0.88,0.90,0.72,0.74)
  day &lt;- as.Date(strptime((seq(20150201,20150206,1)),format = "%Y%m%d"))
  dati = data.frame("Day" = day, "Limit" = limit)
  g &lt;- ggplot(data = dati, aes(Day, Limit))
  g &lt;- g + geom_area(fill = "dark red")
  g &lt;- g + coord_cartesian(ylim = c(0,1))
  g &lt;- g + scale_y_continuous(labels=percent)
  g &lt;- g + annotate("segment", y= 1, yend = 1, x = dati[3, "Day"], xend = dati[4, "Day"])
  print(g)
  </code></pre>
  
  <p>But I get this error: <strong><em>Error: / not defined for "Date" objects</em></strong></p>
  
  <p>Any ideas on how to solve this?</p>
  
  <p>I already checked <a href="https://stackoverflow.com/questions/18796386/how-to-use-ggplot2s-annotate-with-dates-in-x-axis">How to use ggplot2&#39;s annotate with dates in x-axis?</a>, but it appears the bug is back. Plus I'd like to do this without using the lubridate package.</p>