title: Side by side horizontal legends in in ggplot2
body: <p>I would like to get my ggplot legends to appear side by side, underneath the plot with the variable names above the symbols, as they are in <a href="https://kohske.wordpress.com/2010/12/25/various-position-adjustments-of-legend-in-ggplot2/" rel="noreferrer">this</a> blog post (the second plot). The <code>opts</code> function is now defunct, and <code>theme</code> does not appear to replicate its behaviour...</p>
  
  <pre><code>library("ggplot2")
  ggplot(diamonds, aes(x = carat, y=price, shape = cut, group=interaction(cut, color), color=color)) +
  geom_point() +
  #opts(legend.direction = "horizontal", legend.position = "bottom")
  #potential options, not all seem have an effect...
  theme(legend.direction = "horizontal") +
  theme(legend.position = "bottom") +
  theme(legend.box = "vertical") +
  theme(legend.title.align = 0)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/fM1hX.png" alt="enter image description here"></p>
  
  <p>...using my MS paint skills to illustrate the desired plot.</p>