title: Superimposing a log-normal density in ggplot and stat_function()
body: <p>I try to superimpose a function via <code>stat_function()</code> in <code>ggplot</code> but can't figure out my mistake. this example produces a nice looking plot:</p>
  
  <pre><code>data &lt;- data.frame(x=rt(10000, df=7))
  
  ggplot(data=data, aes(x=x)) + geom_histogram(aes(y = ..density..)) +
    stat_function(fun =dnorm, size=1, color='gray', args=list()) +
    opts(title="Histogram of interest rate changes") + theme_bw()
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/nedab.jpg" alt="enter image description here"></p>
  
  <p>but when i try to superimpose a log-normal density this doesn't work as expected (or should I say as expected this doesn't work ;):</p>
  
  <pre><code>data &lt;- data.frame(x=rf(10000, df1=7, df2=120))
  
  ggplot(data=data, aes(x=x)) + geom_histogram(aes(y = ..density..)) +
   stat_function(fun =dnorm, size=1, color='gray', args=list(log=TRUE)) +
   opts(title="Histogram of interest rate changes") + theme_bw()
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/c0wY8.jpg" alt="enter image description here"></p>
  
  <p>so here's my hopefully simple question: what am I doing wrong here? I guess this is a really simple problem I just don't see the answer - sorry.</p>