title: Add legend to "geom_bar" using the ggplot2 package
body: <p>I am a newbie to R, so please pardon my ignorance. I made a pseudo-stacked barplot in which I drew 4 sets of bars on top of each other using geom_bar. There are 4 health status categories (alive, dead, infected, &amp; sod-dead) for three species of oak trees (QUAG, QUKE, QUCH).</p>
  
  <p>My code is as follows:</p>
  
  <hr>
  
  <pre><code>x &lt;- as.data.frame(list(variable=c("QUAG", "QUKE", "QUCH"), alive = c(627,208,109),  infected = c(102,27,0), dead = c(133,112,12), sod.dead=c(49,8,0)))
  
  x.plot = ggplot(x, aes(variable, alive)) + geom_bar(fill="gray85") + 
    geom_bar(aes(variable,dead), fill="gray65") +
    geom_bar(aes(variable, infected), fill="gray38") +
    geom_bar(aes(variable, sod.dead), fill="black")+
    opts(panel.background = theme_rect(fill='gray100'))
  x.plot
  </code></pre>
  
  <hr>
  
  <p>Now I want to make a legend that shows which shade of gray relates to tree status, i.e., "gray65" is "dead trees", etc. I've been trying for the past hour and can't get it to work.</p>