title: get QuadMesh object from Axes (or Figure)
body: <p>I'm trying to make a plot where the various subplots all share a colorbar similar to <a href="https://stackoverflow.com/questions/13784201/matplotlib-2-subplots-1-colorbar">this answer</a>.  The problem that I'm running into is that in my script, I'm calling a function which creates the <code>QuadMesh</code> (generated from <a href="http://matplotlib.org/api/axes_api.html#matplotlib.axes.Axes.pcolormesh" rel="nofollow noreferrer"><code>ax.pcolormesh</code></a>) instance and returns the <code>Figure</code> and <code>Axes</code> instances associated with it.  Is there any way to get a handle on the QuadMesh instance from the Axes instance (or Figure instance)?</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import numpy as np
  
  def foo(subplot):
      data = np.random.random((100,100))
      x,y = np.meshgrid(np.arange(101),np.arange(101))
      fig = plt.gcf()
      ax = fig.add_subplot(subplot)
      quadmesh = ax.pcolormesh(x,y,data)
      return fig,ax
  
  fig = plt.figure()
  f,a = foo(221)
  f,a = foo(222)
  f,a = foo(223)
  f,a = foo(224)
  fig.subplots_adjust(right=0.8)
  cbar_ax = fig.add_axes([0.85,0.15,0.05,0.7])
  #fig.colorbar(magic_get_quadmesh,cax=cbar_ax)
  plt.show()
  </code></pre>