title: How can i make a stacked multiple density plot with ggplot?
body: <p>I have a dataset with 2 columns. The first one is a factor and it simply says the group name, and the second one are the values. I can make one histogram by filtering one group and using geom_histogram. I could also make several histograms on the same plane by using aes(fill=column1), or even make a individual plot for each group histogram by using facet_wrap.</p>
  <p>But how could I get to something like this? (Its a graph from an newspaper on Mexico's elections)
  <a href="https://i.stack.imgur.com/ZK4Sb.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZK4Sb.jpg" alt="histograms by groups" /></a></p>
  <p>Here is some sample code to generate dummy data, I don't have the real data, but it is the aesthetics I am looking for.</p>
  <pre><code>PRI &lt;- rnorm(10000,mean=20,sd=5)
  PAN &lt;- rnorm(10000,mean=100,sd=20)
  PRD &lt;- rnorm(10000,mean=80,sd=15)
  MORENA &lt;- rnorm(10000,mean=244,sd=50)
  PRI &lt;- data.frame(group=&quot;PRI&quot;,value=PRI)
  PAN &lt;- data.frame(group=&quot;PAN&quot;,value=PAN)
  PRD &lt;- data.frame(group=&quot;PRD&quot;,value=PRD)
  MORENA &lt;- data.frame(group=&quot;MORENA&quot;,value=MORENA)
  
  data &lt;- rbind(PRI,PAN,PRD,MORENA)
  ggplot(data=data,aes(x=value,fill=group))+
  geom_histogram(bins=1000)
  </code></pre>