title: ggplot: adding normal distribution curve using stat_function to existing histogram and distribution layers
body: <p>Task that I need to accomplish:
  1. draw x=data/y=density histogram - done
  2. draw distribution curve for given dataset - done
  3. draw perfect normal distribution curve for this dataset (<strong>red line</strong>) - <strong>problem</strong> I assume problem is in 2nd stat_function.</p>
  
  <p>Code is run-able w/o any preparations:</p>
  
  <pre><code>data &lt;- data.frame(c(runif(30,1,50)),c(runif(30,50,1)))
  g.data &lt;- data[,1]
  
  graph &lt;- ggplot(data, aes(g.data))
  graph &lt;- graph +
  geom_histogram(aes(y = ..density..), binwidth = 2, fill = 'pink') +
  labs(x = 'Data', y ='Density') +
  stat_function(fun = dnorm, args = list(mean = mean(g.data, na.rm = T),
  sd = sd(g.data, na.rm =T)), colour ='black', size =1) +
  theme(legend.position = 'none') +
  stat_function(fun = dnorm, colour = "red", args = list(mean = mean(g.data)))
  graph
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/uECrF.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uECrF.jpg" alt=""></a></p>
  
  <p>Here what I get</p>
  
  <p><a href="https://i.stack.imgur.com/8IRKB.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8IRKB.jpg" alt=""></a></p>
  
  <p>Here what I approximately need, perfect norm. distribution</p>