title: manually create ggplot legend when plot built from two data frames
body: <p>I am using ggplot to create two overlapping density from two different data frames.  I need to create a legend for each of the densities.</p>
  <p>I have been trying to follow these two posts, but still cannot get it to work:</p>
  <p><a href="https://stackoverflow.com/questions/58789168/how-to-add-legend-to-plot-with-data-from-multiple-data-frames">How to add legend to plot with data from multiple data frames</a></p>
  <p><a href="https://stackoverflow.com/questions/38907371/ggplot-legends-when-plot-is-built-from-two-data-frames">ggplot legends when plot is built from two data frames</a></p>
  <p>Sample code of what I am trying to do:</p>
  <pre><code>df1 = data.frame(x=rnorm(1000,0))
  df2 = data.frame(y=rnorm(2500,0.5))
  
  ggplot() +
    geom_density(data=df1, aes(x=x), color='darkblue', fill='lightblue', alpha=0.5) + 
    geom_density(data=df2, aes(x=y), color='darkred', fill='indianred1', alpha=0.5) +
    scale_color_manual('Legend Title', limits=c('x', 'y'), values = c('darkblue','darkred')) +
    guides(colour = guide_legend(override.aes = list(pch = c(21, 21), fill = c('darkblue','darkred')))) +
    theme(legend.position = 'bottom')
  </code></pre>
  <p>Is it possible to manually create a legend?</p>
  <p>Or do I need to restructure the data as per this post?</p>
  <p><a href="https://stackoverflow.com/questions/46433741/adding-legend-to-ggplot-made-from-multiple-data-frames-with-controlled-colors">Adding legend to ggplot made from multiple data frames with controlled colors</a></p>
  <p>I'm newish to R so hoping to avoid stacking the data into a single dataframe if I can avoid it as they are weighted densities so have to multiply by different weights as well.</p>