def findobj(self, match=None):
if match is None: <EOL><INDENT>def matchfunc(x): return True<EOL><DEDENT>elif cbook.issubclass_safe(match, Artist):<EOL><INDENT>def matchfunc(x):<EOL><INDENT>return isinstance(x, match)<EOL><DEDENT><DEDENT>elif callable(match):<EOL><INDENT>matchfunc = match<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>artists = []<EOL>for c in self.get_children():<EOL><INDENT>if matchfunc(c):<EOL><INDENT>artists.append(c)<EOL><DEDENT>artists.extend([thisc for thisc in c.findobj(matchfunc) if matchfunc(thisc)])<EOL><DEDENT>if matchfunc(self):<EOL><INDENT>artists.append(self)<EOL><DEDENT>return artists<EOL>
pyplot signature:
  findobj(o=gcf(), match=None)

Recursively find all :class:matplotlib.artist.Artist instances
contained in self.

*match* can be

  - None: return all objects contained in artist (including artist)

  - function with signature ``boolean = match(artist)`` used to filter matches

  - class instance: eg Line2D.  Only return artists of class type

.. plot:: mpl_examples/pylab_examples/findobj_demo.py