title: ggplot: legend for a plot the combines bars / lines?
body: <p>I have a empirical PDF + CDF combo I'd like to plot on the same panel.  <code>distro.df</code> has columns <code>pdf</code>, <code>cdf</code>, and <code>day</code>.  I'd like the pdf values to be plotted as bars, and the cdf as lines.  This does the trick for making the plot:</p>
  
  <pre><code>p &lt;- ggplot(distro.df, aes(x=day))
  p &lt;- p + geom_bar(aes(y=pdf/max(pdf)), stat="identity", width=0.95, fill=fillCol)
  p &lt;- p + geom_line(aes(y=cdf))
  p &lt;- p + xlab("Day") + ylab("")
  p &lt;- p + theme_bw() + theme_update(panel.background = element_blank(), panel.border=element_blank())
  </code></pre>
  
  <p>However, I'm having trouble getting a legend to appear.  I'd like a line for the cdf and a filled block for the pdf.  I've tried various contortions with guides, but can't seem to get anything to appear.</p>
  
  <p>Suggestions?</p>
  
  <p>EDIT:</p>
  
  <p>Per @Henrik's request: to make a suitable <code>distro.df</code> object:</p>
  
  <pre><code>df &lt;- data.frame(day=0:10)
  df$pdf &lt;- runif(length(df$day))
  df$pdf &lt;- df$pdf / sum(df$pdf)
  df$cdf &lt;- cumsum(df$pdf)
  </code></pre>
  
  <p>Then the above to make the plot, then invoke <code>p</code> to see the plot.</p>