@@ -1081,15 +1081,7 @@ def matchfunc(x):
10811081 raise ValueError ('match must be None, a matplotlib.artist.Artist '
10821082 'subclass, or a callable' )
10831083
1084- artists = []
1085-
1086- for c in self .get_children ():
1087- if matchfunc (c ):
1088- artists .append (c )
1089- artists .extend ([thisc for thisc in
1090- c .findobj (matchfunc , include_self = False )
1091- if matchfunc (thisc )])
1092-
1084+ artists = sum ([c .findobj (matchfunc ) for c in self .get_children ()], [])
10931085 if include_self and matchfunc (self ):
10941086 artists .append (self )
10951087 return artists
@@ -1409,45 +1401,6 @@ def pprint_getters(self):
14091401 lines .append (' %s = %s' % (name , s ))
14101402 return lines
14111403
1412- def findobj (self , match = None ):
1413- """
1414- Recursively find all :class:`matplotlib.artist.Artist`
1415- instances contained in *self*.
1416-
1417- If *match* is not None, it can be
1418-
1419- - function with signature ``boolean = match(artist)``
1420-
1421- - class instance: e.g., :class:`~matplotlib.lines.Line2D`
1422-
1423- used to filter matches.
1424- """
1425- if match is None : # always return True
1426- def matchfunc (x ):
1427- return True
1428- elif issubclass (match , Artist ):
1429- def matchfunc (x ):
1430- return isinstance (x , match )
1431- elif callable (match ):
1432- matchfunc = func
1433- else :
1434- raise ValueError ('match must be None, a matplotlib.artist.Artist '
1435- 'subclass, or a callable' )
1436-
1437- artists = []
1438-
1439- for c in self .get_children ():
1440- if matchfunc (c ):
1441- artists .append (c )
1442- artists .extend ([thisc
1443- for thisc
1444- in c .findobj (matchfunc )
1445- if matchfunc (thisc )])
1446-
1447- if matchfunc (self ):
1448- artists .append (self )
1449- return artists
1450-
14511404
14521405def getp (obj , property = None ):
14531406 """
0 commit comments