Skip to content

Commit b71dedc

Browse files
committed
Include length in ArtistList repr.
Previously, printing e.g. `ax.lines` would show a bunch of `<Line2D object at 0x...>`. Now it's all hidden between an `<ArtistList>`, which is useful in itself; but displaying the length of the list (which is the main thing that could be seen from the `[<Line2D object at 0x...>` representation) is useful at least for debugging purposes.
1 parent 07fd38f commit b71dedc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,7 @@ def __init__(self, axes, prop_name, add_name,
13471347
)
13481348

13491349
def __repr__(self):
1350-
return f'<Axes.ArtistList of {self._prop_name}>'
1350+
return f'<Axes.ArtistList of {len(self)} {self._prop_name}>'
13511351

13521352
def __len__(self):
13531353
return sum(self._type_check(artist)

0 commit comments

Comments
 (0)