Skip to content

Commit 8308603

Browse files
committed
Add __iter__ implementation to ArtistList.
1 parent 45c8d97 commit 8308603

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
@@ -1269,6 +1269,11 @@ def __len__(self):
12691269
return sum(self._type_check(artist)
12701270
for artist in self._axes._children)
12711271

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

0 commit comments

Comments
 (0)