title: ggplot: position legend in top left
body: <p>I have a plot made with ggplot2 and I'd like to get the legend positioned in the <strong>top left corner</strong>. </p>
  
  <p><code>legend.position = "top"</code> gets me a legend positioned above the plot, but centered:</p>
  
  <p><img src="https://i.stack.imgur.com/K35wi.png" alt="Legend is on top, but centered"></p>
  
  <p><code>legend.position = c(0,1)</code> gets the legend in the top left, but it floats over the other plot elements:</p>
  
  <p><img src="https://i.stack.imgur.com/WUUEN.png" alt="Look at that legend float!"></p>
  
  <p>Know how to get that legend up in the top left without having it float? I tried declaring the legend height, but no dice. Do I have to adjust the size and position of the title and plot area?</p>
  
  <p>Thanks!</p>