title: Can I place my ggplot2 legend right beside the horizontal axis label?
body: <p>In order to save as much as white space as I can, I would like to place the legend entry at the same height as the horizontal axis label. Can this be done and if so, how?</p>
  
  <p>Here's a plot illustrating what I am hoping to achieve, with current and hoped-for legend position illustrated using a (manually added) green box.</p>
  
  <p><a href="https://i.stack.imgur.com/LaAIb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LaAIb.png" alt="enter image description here"></a></p>
  
  <p>I currently place the legend using <code>theme(legend.position=c(0.87,0.1))</code> (noting that the exact coordinates are not relevant). Ideally, this route would allow for values outside of the [0,1] domain but it appears not to allow for that.</p>
  
  <p><code>theme(legend.position="bottom")</code> places the legend well outside of the plotting area, thus taking up more white space than I am willing to spare.</p>