title: How do I fix an aspect ratio in ggplot2's geom_hex?
body: <p>I'd like to use <code>geom_hex</code> to represent my counts, but I want the hexagons to be "square", with an aspect ratio 1:1.</p>
  
  <p>I've seen <code>coord_fixed</code> (and its alias <code>coord_equal</code>), but these change the aspect ratio of the whole plotted area, while I'm interested in changing the aspect ratio of the hexagons themselves.</p>
  
  <pre class="lang-r prettyprint-override"><code>library(ggplot2)
  
  # Here, in plot1.pdf, the hexagon aspect ratio is determined by 
  # the saved plot aspect ratio
  plt1 &lt;- ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length)) +
    geom_hex(bins = 10)
  ggsave("plot1.pdf", plt1, width = 5, height = 4)
  
  
  # Here, in plot2.pdf, the hexagon aspect ratio is 1:1, but the
  # plot doesn't fill the space well, particularly if the data change
  ratio &lt;- 2
  plt2 &lt;- ggplot(iris, aes(x = Sepal.Width, y = Sepal.Length)) +
    geom_hex(bins = 10 * c(1, ratio)) +
    coord_fixed(ratio = ratio)
  ggsave("plot2.pdf", plt2, width = 5, height = 4)
  
  
  # In plot3.pdf, the only thing that's changed is the y-axis data,
  # but the plot is unreadable because the x-axis is so compressed
  ratio &lt;- 2
  plt3 &lt;- ggplot(iris, aes(x = Sepal.Width, y = 5 * Sepal.Length)) +
    geom_hex(bins = 10 * c(1, ratio)) +
    coord_fixed(ratio = ratio)
  ggsave("plot3.pdf", plt3, width = 5, height = 4)
  
  </code></pre>
  
  <p>In <code>plot2.pdf</code> and <code>plot3.pdf</code> above, the hexagons have a 1:1 aspect ratio, but the plots don't look good, because <code>coord_fixed</code> has scaled the entire plotted area, not just the hexagons. </p>
  
  <p>In each plot, I could tweak the <code>bins</code> argument to get hexagons with an aspect ratio near 1:1, but I'd like to have the code pick automatically for me. Is there a way to say something like "pick 15 bins on the x-axis and however many bins are necessary on the y-axis to make the hexagons have a 1:1 aspect ratio"?</p>