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

Skip to content

Commit 8737ac3

Browse files
committed
Add __iter__ implementation to ArtistList.
1 parent 669cb82 commit 8737ac3

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
@@ -1353,6 +1353,11 @@ def __len__(self):
13531353
return sum(self._type_check(artist)
13541354
for artist in self._axes._children)
13551355

1356+
def __iter__(self):
1357+
for artist in self._axes._children:
1358+
if self._type_check(artist):
1359+
yield artist
1360+
13561361
def __getitem__(self, key):
13571362
return [artist
13581363
for artist in self._axes._children

0 commit comments

Comments
 (0)