title: How to add legend to a CausalImpact plot object
body: <p>I'm using the CausalImpact package, developed by Google folks, to assess the causal impact of an intervention in a time series.</p>
  
  <p><a href="https://google.github.io/CausalImpact/CausalImpact.html#using-a-custom-model" rel="nofollow">See the documentation for more info</a>.</p>
  
  <p>I created a plot, like in the example. And I'd like to add a legend, like we find <a href="http://static.googleusercontent.com/media/research.google.com/pt-BR//pubs/archive/41854.pdf" rel="nofollow">here</a>, in page 249.</p>
  
  <p>I know that using the function plot (of CausalImpact package) produces a ggplot2 object. However, I don't know how to add a legend.</p>
  
  <p>Some reproducible data:</p>
  
  <pre><code>library(devtools)
  devtools::install_github("google/CausalImpact")
  library(CausalImpact)
  
  set.seed(1)
  x1 &lt;- 100 + arima.sim(model = list(ar = 0.999), n = 100)
  y &lt;- 1.2 * x1 + rnorm(100)
  y[71:100] &lt;- y[71:100] + 10
  data &lt;- cbind(y, x1)
  pre.period &lt;- as.Date(c("2014-01-01", "2014-03-11"))
  post.period &lt;- as.Date(c("2014-03-12", "2014-04-10"))
  time.points &lt;- seq.Date(as.Date("2014-01-01"), by = 1, length.out = 100)
  data &lt;- zoo(cbind(y, x1), time.points)
  impact &lt;- CausalImpact(data, pre.period, post.period)
  plot(impact)
  </code></pre>