title: Kernel density plots on a single figure
body: <p>I have been trying to plot simple density plots using R as:</p>
  
  <pre><code>plot(density(Data$X1),col="red")
  plot(density(Data$X2),col="green")
  </code></pre>
  
  <p>Since I want to compare, I'd like to plot both in one figure. But 'matplot' doesn't work!! I also tried with ggplot2 as:</p>
  
  <pre><code>library(ggplot2)
  qplot(Data$X1, geom="density")
  qplot(Data$X2, add = TRUE, geom="density")
  </code></pre>
  
  <p>Also in this case, plots appear separately (though I wrote add=TRUE)!! Can anyone come up with an easy solution to the problem, please?</p>