Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 27c7d53

Browse files
committed
Add __iter__ implementation to ArtistList.
1 parent b9619cc commit 27c7d53

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,11 @@ def __len__(self):
12701270
return sum(self._type_check(artist)
12711271
for artist in self._axes._children)
12721272

1273+
def __iter__(self):
1274+
for artist in self._axes._children:
1275+
if self._type_check(artist):
1276+
yield artist
1277+
12731278
def __getitem__(self, key):
12741279
return [artist
12751280
for artist in self._axes._children

0 commit comments

Comments
 (0)