Skip to content

Commit 7555896

Browse files
committed
Add __iter__ implementation to ArtistList.
1 parent ffbd6b1 commit 7555896

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
@@ -1263,6 +1263,11 @@ def __len__(self):
12631263
return sum(self._type_check(artist)
12641264
for artist in self._axes._children)
12651265

1266+
def __iter__(self):
1267+
for artist in self._axes._children:
1268+
if self._type_check(artist):
1269+
yield artist
1270+
12661271
def __getitem__(self, key):
12671272
return [artist
12681273
for artist in self._axes._children

0 commit comments

Comments
 (0)