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

Skip to content

Commit b2e3f7e

Browse files
committed
Add __iter__ implementation to ArtistList.
1 parent 6898cc8 commit b2e3f7e

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

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

0 commit comments

Comments
 (0)