Skip to content

Commit 17cd363

Browse files
committed
DOC : clarified doc of add_artist
Added note about add_artist not automatically updating the data limits used by the auto-scaling.
1 parent 1ecafbb commit 17cd363

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,8 +1423,12 @@ def has_data(self):
14231423
len(self.patches)) > 0
14241424

14251425
def add_artist(self, a):
1426-
"""
1427-
Add any :class:`~matplotlib.artist.Artist` to the axes.
1426+
"""Add any :class:`~matplotlib.artist.Artist` to the axes.
1427+
1428+
Use `add_artist` only for artists for which there is no dedicated
1429+
"add" method; and if necessary, use a method such as
1430+
`update_datalim` or `update_datalim_numerix` to manually update the
1431+
dataLim if the artist is to be included in autoscaling.
14281432
14291433
Returns the artist.
14301434
"""

0 commit comments

Comments
 (0)