title: Density plot and histogram in ggplot2
body: <p>I have the following data frame</p>
  
  <pre><code>        x1&lt;-data.frame(n = rnorm(1000000, mean=0, sd=1), nombre= "x1")
  
          x2&lt;-data.frame(n=rnorm(1500000, mean=3, sd=1), nombre= "x2")
  
          x&lt;-rbind(x1, x2)
  
          ggplot(x, aes(n, fill=nombre))+
            geom_histogram(alpha=0.5, binwidth=0.25, position = "identity")+
            geom_density()
  </code></pre>
  
  <p>I would like to overlay the density plot to the histogram, but it just appears like a thin line in 0</p>
  
  <p><a href="https://i.stack.imgur.com/W3us5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W3us5.png" alt="enter image description here"></a></p>