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

Skip to content

Commit f7538b8

Browse files
committed
DOC: Document set_figure() is a low-level API
Closes #31135.
1 parent 51fbfc4 commit f7538b8

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

doc/api/axes_api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ Units
450450
Axes.convert_yunits
451451
Axes.have_units
452452

453+
.. _axes-api-adding-artists:
453454

454455
Adding artists
455456
==============

lib/matplotlib/artist.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,19 @@ def set_figure(self, fig):
767767
"""
768768
Set the `.Figure` or `.SubFigure` instance the artist belongs to.
769769
770+
.. warning::
771+
772+
This function should typically not be called by users.
773+
774+
This is a low-level API and only modifies the internal state of the
775+
Artist. Only modifying this is not enough and will typically lead
776+
to an inconsistent state, because the state of the figure has to
777+
be changed as well.
778+
779+
Users should typically instead call one of the high-level APIs, i.e.
780+
`.Figure.add_artist` or one of the Axes methods
781+
:ref:`axes-api-adding-artists`.
782+
770783
Parameters
771784
----------
772785
fig : `~matplotlib.figure.Figure` or `~matplotlib.figure.SubFigure`

0 commit comments

Comments
 (0)