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

Skip to content

Commit af1b3cd

Browse files
authored
Merge pull request #31140 from timhoffm/doc-set_figure
DOC: Document set_figure() is a low-level API
2 parents 60dd2e2 + f7538b8 commit af1b3cd

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
@@ -773,6 +773,19 @@ def set_figure(self, fig):
773773
"""
774774
Set the `.Figure` or `.SubFigure` instance the artist belongs to.
775775
776+
.. warning::
777+
778+
This function should typically not be called by users.
779+
780+
This is a low-level API and only modifies the internal state of the
781+
Artist. Only modifying this is not enough and will typically lead
782+
to an inconsistent state, because the state of the figure has to
783+
be changed as well.
784+
785+
Users should typically instead call one of the high-level APIs, i.e.
786+
`.Figure.add_artist` or one of the Axes methods
787+
:ref:`axes-api-adding-artists`.
788+
776789
Parameters
777790
----------
778791
fig : `~matplotlib.figure.Figure` or `~matplotlib.figure.SubFigure`

0 commit comments

Comments
 (0)