title: Turn hist2d output into contours in matplotlib
body: <p>I have generated some data in Python using matplotlib.hist2d.  An example of the data is seen below. <img src="https://i.imgur.com/WNdWsZc.png" alt="data"></p>
  
  <p>As you can see this data has some contours in it found by tracing the same color throughout the plot.  I see a gamma distribution centered around 0.015.  I would like to take this data and gather these contours so I can see a line trace through each color level.  I tried playing around with the contour function as here</p>
  
  <pre><code>counts, xedges, yedges, Image = hist2d(x, y, bins=bins, norm=LogNorm(), range=[[0, 1], [0, 400]])
  contour(counts)
  </code></pre>
  
  <p>but that didn't seem to produce anything.</p>
  
  <p>Does anyone know the best way to get these contours?  Ideally I'd like to take these contours and fit a function (like a gamma function) to them and then get the function parameters.</p>
  
  <p>Thanks</p>