title: ggplot2 legend to bottom and horizontal
body: <p>How can I move a <code>ggplot2</code> legend to the bottom of the plot and turn it horizontally?</p>
  <p><strong>Sample code:</strong></p>
  <pre><code>library(reshape2) # for melt
  df &lt;- melt(outer(1:4, 1:4), varnames = c(&quot;X1&quot;, &quot;X2&quot;))
  p1 &lt;- ggplot(df, aes(X1, X2)) + geom_tile(aes(fill = value))
  p1 + scale_fill_continuous(guide = guide_legend())
  </code></pre>
  <p><strong>Desired (approximate) outcome:</strong>
  <img src="https://i.stack.imgur.com/Vb3Mg.png" alt="enter image description here" /></p>