title: Adding a legend to ggplot when using stat_function
body: <p>I'm trying to add a legend to ggplot to differentiate between a simulated normal distribution and a generated one. Below is my code</p>
  
  <pre><code>set.seed(1)
  lambda = .2
  n = 40
  sim = 10000
  means = replicate(sim, expr = mean(rexp(n,lambda)))
  ggplot(data.frame(means), aes(x=means)) + 
             geom_density() + 
             stat_function(fun = dnorm, color = "blue", 
                           arg = list(mean = 1/lambda, sd=sqrt(lambda^-2/n))) + 
             scale_colour_manual("Legend title", values = c("red", "blue"))
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/sTpye.png" alt="Rplot"></p>
  
  <p>I tried using scale_colour_manual as given another stackoverflow answer but I can't get a legend to show up.</p>
  
  <p>Reference answer
  <a href="https://stackoverflow.com/questions/19950219/using-legend-with-stat-function-in-ggplot2">Using legend with stat_function in ggplot2</a></p>