title: How to get a list of collections on a matplotlib figure?
body: <p>I am trying to get a list of collections (scatter plots) on a particular matplotlib figure.</p>
  
  <p>For normal line plots this can be accomplished by</p>
  
  <pre><code>lines = [ line for axis in figure.axes for line in axis.get_lines()]
  </code></pre>
  
  <p>where <code>axis.get_lines()</code> will give me a list of line objects associated with that axis. How do I do a similar operation for <code>PathCollections</code> or collections in general? The object figure.axes does not seem to have a <code>.get_collections()</code> option?</p>
  
  <p>Note: I have done this using <code>axes.get_legend_handles_labels()</code> and just used the handles but this only works if each scatter has a label as well, as far as I can tell. </p>