Skip to content

Commit 9da646a

Browse files
committed
Add __iter__ implementation to ArtistList.
1 parent af194ec commit 9da646a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/matplotlib/axes/_base.py

+5
Original file line numberDiff line numberDiff line change
@@ -1267,6 +1267,11 @@ def __len__(self):
12671267
return sum(self._type_check(artist)
12681268
for artist in self._axes._children)
12691269

1270+
def __iter__(self):
1271+
for artist in self._axes._children:
1272+
if self._type_check(artist):
1273+
yield artist
1274+
12701275
def __getitem__(self, key):
12711276
return [artist
12721277
for artist in self._axes._children

0 commit comments

Comments
 (0)