MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / set_figure

Method set_figure

lib/matplotlib/figure.py:271–287  ·  view source on GitHub ↗

.. deprecated:: 3.10 Currently this method will raise an exception if *fig* is anything other than the root `.Figure` this (Sub)Figure is on. In future it will always raise an exception.

(self, fig)

Source from the content-addressed store, hash-verified

269 return self._parent
270
271 def set_figure(self, fig):
272 """
273 .. deprecated:: 3.10
274 Currently this method will raise an exception if *fig* is anything other
275 than the root `.Figure` this (Sub)Figure is on. In future it will always
276 raise an exception.
277 """
278 no_switch = ("The parent and root figures of a (Sub)Figure are set at "
279 "instantiation and cannot be changed.")
280 if fig is self._root_figure:
281 _api.warn_deprecated(
282 "3.10",
283 message=(f"{no_switch} From Matplotlib 3.12 this operation will raise "
284 "an exception."))
285 return
286
287 raise ValueError(no_switch)
288
289 figure = property(functools.partial(get_figure, root=True), set_figure,
290 doc=("The root `Figure`. To get the parent of a `SubFigure`, "

Callers 3

add_artistMethod · 0.45
textMethod · 0.45
_set_artist_propsMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected