Files
intellecton/venv/lib/python3.12/site-packages/matplotlib/__pycache__/figure.cpython-312.pyc
T

2197 lines
151 KiB
Plaintext
Raw Normal View History

Ë
†Rj.+ãódZddlmZddlZddlZddlZddlZddlmZddl Z ddl
Z ddl Z
ddl mZmZmZmZddlmZmZmZddlmZmZmZmZmZddlmZddlmZddl m!Z"ddl#m$Z%ddl&m'Z'dd l(m)Z)m*Z*dd
l+m,Z,m-Z-m.Z.m/Z/ddl0m1Z2dd l3m4Z4dd l5m6Z6dd
l7m8Z8m9Z9m:Z:m;Z;ejxe=«Z>dZ?Gdd«Z@Gdde«ZAej„GddeA««ZCej„GddeA««ZDdZEy)
`matplotlib.figure` implements the following classes:
`Figure`
Top level `~matplotlib.artist.Artist`, which holds all plot elements.
Many methods are implemented in `FigureBase`.
`SubFigure`
A logical figure inside a figure, usually added to a figure (or parent `SubFigure`)
with `Figure.add_subfigure` or `Figure.subfigures` methods.
Figures are typically created using pyplot methods `~.pyplot.figure`,
`~.pyplot.subplots`, and `~.pyplot.subplot_mosaic`.
.. plot::
:include-source:
fig, ax = plt.subplots(figsize=(2, 2), facecolor='lightskyblue',
layout='constrained')
fig.suptitle('Figure')
ax.set_title('Axes', loc='left', fontstyle='oblique', fontsize='medium')
Some situations call for directly instantiating a `~.figure.Figure` class,
usually inside an application of some sort (see :ref:`user_interfaces` for a
list of examples) . More information about Figures can be found at
:ref:`figure-intro`.
é)Ú ExitStackN)ÚIntegral)Ú_blocking_inputÚ
backend_basesÚ
_docstringÚ projections)ÚArtistÚallow_rasterizationÚ_finalize_rasterization)Ú DrawEventÚFigureCanvasBaseÚNonGuiExceptionÚ MouseButtonÚ
_get_renderer)ÚAxes)ÚGridSpecÚ
SubplotParams)ÚConstrainedLayoutEngineÚTightLayoutEngineÚ LayoutEngineÚPlaceHolderLayoutEngine)Ú Rectangle)ÚText)ÚAffine2DÚBboxÚBboxTransformToÚTransformedBboxcó<|jd¬«x}||_yy)NF©Úroot)Ú
get_figureÚstale)ÚselfÚvalÚfigs úT/home/antigravity/intellecton/venv/lib/python3.12/site-packages/matplotlib/figure.pyÚ_stale_figure_callbackr'As$Ø EˆÓЈ ðcó@eZdZdZdZdZdZdZdZdZ dZ
d „Z y
) Ú
_AxesStacka

Helper class to track Axes in a figure.
Axes are tracked both in the order in which they have been added
(``self._axes`` insertion/iteration order) and in the separate "gca" stack
(which is the index to which they map in the ``self._axes`` dict).
cóDi|_tj«|_y©N)Ú_axesÚ itertoolsÚcountÚ_counter©r#s r&Ú__init__z_AxesStack.__init__Os؈Œ
ÜÓ)ˆ
r(cóg|j¢S)z1List the Axes that have been added to the figure.)r-r1s r&Úas_listz_AxesStack.as_listSsàˆ}Ðr(có:|jj|«y)zRemove the Axes from the stack.N)r-Úpop©r#Úas r&Úremovez_AxesStack.removeWsà
r(cóz||jvr td«t|j«|j|<y)z@Move an Axes, which must already exist in the stack, to the top.zAxes has not been added yetN)r-Ú
ValueErrorÚnextr0r7s r&Úbubblez_AxesStack.bubble[s0à D—J ÜÐ ˜TŸ]™]Ó
r(cóf||jvr#t|j«|j|<yy)z9Add an Axes to the stack, ignoring it if already present.N)r-r<r0r7s r&Úaddz_AxesStack.addas)à D—J‘JÑ Ü  §¡Ó/ˆDJ‰JqŠMð r(cóZt|j|jjd¬«S)z6Return the active Axes, or None if the stack is empty.N)ÚkeyÚdefault)Úmaxr-Ú __getitem__r1s r&Úcurrentz_AxesStack.currentfsä4—:: 4§:¡:×#9Ñ#9À4ÔHr(cójit|«¥dt|jj«d¬«i¥S)Nr0r)rB)ÚvarsrCr-Úvaluesr1s r&Ú __getstate__z_AxesStack.__getstate__js6ð
Ü4
à œ˜DŸJ™J×Ô
ð
r(cóŽ|jd«}t|«j|«tj|«|_y)Nr0)r6rGÚupdater.r/r0)r#ÚstateÚ next_counters r&Ú __setstate__z_AxesStack.__setstate__ps2Ø—yy Ó Ü ˆT‹
×ј%Ô Ü¨ Ó
r(N) Ú__name__Ú
__module__Ú __qualname__Ú__doc__r2r4r9r=r?rErIrN©r(r&r*r*Fs0ñòòò 
Iò
ó 6r(r*c óÜeZdZdZˆfdZdZ dQdZdZdRdZdZ e
e jed ¬
«e d ¬ «Z
d
ZdRdZdZdZej&dddddd¬«ej(e«d««ZdZej&dddddd¬«ej(e«d««ZdZej&d dd!d"dd¬«ej(e«d#„««Zd$„Zd%„Zd&„Zd'„Zd(„Zd)„Zd*„Z d+„Z!d,„Z"e
ee"«Z#dSd.„Z$ejJd/„«Z&ejJd0„«Z'd1„Z(dTd-d-d ddddd2œd3„Z)d4„Z*d5„Z+dSd6„Z,dSd7„Z-ejJd8„«Z.ejJdRd9„«Z/ejJ dUd:„«Z0 dVd;„Z1dRd<„Z2dRd=„Z3dRd>„Z4dRd?„Z5dTd@„Z6 dWdA„Z7dB„Z8dC„Z9dD„Z:dE„Z;dd-ddFœdG„Z<dH„Z=dRddIœdJ„Z>e?dK„«Z@e?dL„«ZAd-d-dddMddddNœdO„ZBdP„ZCˆxZDS)XÚ
FigureBasez
Base class for `.Figure` and `.SubFigure` containing the methods that add
artists to the figure or subfigure, create Axes, etc.
c ó‚t|«|`d|_d|_d|_t
j«t
j«t
j«dœ|_g|_ g|_
g|_ g|_ g|_
g|_g|_g|_d|_d|_|j&di|¤Žy)N)ÚtitleTrS)Úsuperr2r-Ú _suptitleÚ
_supxlabelÚ
_supylabelÚcbookÚGrouperÚ_align_label_groupsÚ
_localaxesÚartistsÚlinesÚpatchesÚtextsÚimagesÚlegendsÚsubfigsr"ÚsuppressCompositeÚset)r#ÚkwargsÚ __class__s €r&r2zFigureBase.__init__{ø€Ü
ÑÔð
ˆJàˆŒØˆŒØˆŒô ÜÜ—]‘]“_ñ$
ˆÔ 𠈌؈Œ ؈Œ
؈Œ ؈Œ
؈Œ ؈Œ ؈Œ ؈Œ
Ø!%ˆÔ؈Ñr(cóœ|j«}|j|j«td|D«d¬«}|jD]|}|j «}|j
|r |||«nd«|j«D];}t|d«sŒ|j «}|j
|r |||«nd«Œ=Œ~|S)zAlso runs apply_aspectc3óBK|]}|j«rŒ|Œy­wr,)Ú get_animated)Ú.0Úartists r&ú <genexpr>z/FigureBase._get_draw_artists.<locals>.<genexpr>¢sèø€Ò G˜°×1DÑ1DÕ1FŒVÑ Gùs˜có"|j«Sr,)Ú
get_zorder)rqs r&ú<lambda>z.FigureBase._get_draw_artists.<locals>.<lambda>£s˜v×2€r()rA apply_aspect)Ú get_childrenr9ÚpatchÚsortedraÚget_axes_locatorrvÚhasattr)r#ÚrendererrbÚaxÚlocatorÚchilds r&Ú_get_draw_artistszFigureBase._get_draw_artistsœà×àt—zÙ G  4ˆð—/‘/ò GˆBØ×+ˆGØ O‰O±W™G B¨Ô1À$Ô ŸÓ
Gܘ5 #×6×&Ù4;™  õGñ
Gð  Gðˆr(cótjgd¢|¬«|jDcgc]}|jdk7sŒ|Œ}}t d|D««}t |«dk(rG|jdj
|¬«D]$}|j|«|j|«Œ&nš|r˜|D]“}|j«j«r:|j
|¬«D]$}|j|«|j|«Œ&Œ[|j
|¬«D]}|jd«Œ|jd«Œ•|j«} |r | | jr|j|¬
«d |_y cc}w) a\
Date ticklabels often overlap, so it is useful to rotate them
and right align them. Also, a common use case is a number of
subplots with shared x-axis where the x-axis is date data. The
ticklabels are often long, and it helps to rotate them on the
bottom subplot and turn them off on other subplots, as well as
turn off xlabels.
Parameters
----------
bottom : float, default: 0.2
The bottom of the subplots for `subplots_adjust`.
rotation : float, default: 30 degrees
The rotation angle of the xtick labels in degrees.
ha : {'left', 'center', 'right'}, default: 'right'
The horizontal alignment of the xticklabels.
which : {'major', 'minor', 'both'}, default: 'major'
Selects which ticklabels to rotate.
)ÚmajorÚminorÚboth)Úwhichz
<colorbar>c3ó<K|]}|j«Œy­wr,)Úget_subplotspec)rpr}s r&rrz+FigureBase.autofmt_xdate.<locals>.<genexpr>Æsèø€Ò>°2˜"×,×>ùsérN)ÚbottomT)Ú_apiÚ
check_in_listÚaxesÚ_labelÚallÚlenÚget_xticklabelsÚset_haÚ set_rotationr‡Ú is_last_rowÚ set_visibleÚ
set_xlabelÚget_layout_engineÚadjust_compatibleÚsubplots_adjustr")
r#ÚrotationÚhar…r}rÚ allsubplotsÚlabelÚengines
r&Ú
autofmt_xdatezFigureBase.autofmt_xdate¯sgô*
×ÑÒ5¸UÕ!ŸY™YÖDr¨"¯)©)°|Ó*CÐDˆÐÑ>¸Ô>ˆ Ü ˆt9˜Š>ØŸ 1™×5¸EÐ
-Ø ˜ Ø×" 
Øò*×+×9Ø%'×%7Ñ%7¸eÐ%7Ó%Dò9˜!ŸL™L¨Ô.¨xÕ&(×%7Ñ%7¸eÐ%7Ó%Dò5˜!×-¨eÕŸ
 ×)ˆÙ ˜F˜N¨f×.FÒ.FØ × Ñ ¨Ð Ô ˆ
ùò+Es
¨E>½E>cóÜ|jg|j¢|j¢|j¢|j¢|j
¢|j ¢|j¢|j¢S)z.Get a list of artists contained in the figure.) rxrbrarcrdrerfrgrhr1s r&rwzFigureBase.get_childrenÜsà
ðØðàððððð ð
ð ð ð
ððððð r(NcóØ|j|ur|S|j|jur |jS|d}tjd|¬«d}|r |jS|jS)a•
Return the `.Figure` or `.SubFigure` instance the (Sub)Figure belongs to.
Parameters
----------
root : bool, default=True
If False, return the (Sub)Figure this artist is on. If True,
return the root Figure for a nested tree of SubFigures.
.. deprecated:: 3.10
From version 3.12 *root* will default to False.
zÿFrom Matplotlib 3.12 SubFigure.get_figure will by default return the direct parent figure, which may be a SubFigure. To suppress this warning, pass the root parameter. Pass `True` to maintain the old behavior and `False` to opt-in to the future behavior.ú3.10©ÚmessageT)Ú _root_figureÚ_parentrÚwarn_deprecated)r#r s r&r!zFigureBase.get_figureèsqð × Ñ  Ñ ˆ <‰<˜4× —< à ˆ.ˆ
× Ñ  °Õ ˆDá Ø× |‰|Ðr(cónd}||jurtjd|d¬«yt|«)
.. 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.
z\The parent and root figures of a (Sub)Figure are set at instantiation and cannot be changed.r¢z= From Matplotlib 3.12 this operation will raise an exception.r£N)rr;)r#r%Ú no_switchs r&Ú
set_figurezFigureBase.set_figuresGð<ˆ à  × Ñ ØØ%˜')ð

ä˜Ó#r(TrzTThe root `Figure`. To get the parent of a `SubFigure`, use the `get_figure` method.©Údoccó”|j|«rdifS|jj|j|j«}|ifS)z|
Test whether the mouse event occurred on the figure.
Returns
-------
bool, {}
F)Ú_different_canvasÚbboxÚcontainsrWrX)r#Ú
mouseeventÚinsides r&zFigureBase.contains%sDð × !  ˜" Ø×# J§L¡L°*·,±,Ó?ˆØrˆr(có|jSr,©©r#r|s r&Úget_window_extentzFigureBase.get_window_extent2s ày‰yÐr(c ó4|jdd«}|jdd«}|ddvr|du}n |ddk(r|du}||d}||d}tj|t«}|j d |d
«|j d |d «|j d
|d
«d|vrL|j dt
j |d«|j dt
j |d«t||d«}|7|j|«|j||f«|jdi|¤ŽnN|j|||fi|¤Ž}t||d|«tj|j|d¬«|_|_d|_|S)
Add a centered %(name)s to the figure.
Parameters
----------
t : str
The %(name)s text.
x : float, default: %(x0)s
The x location of the text in figure coordinates.
y : float, default: %(y0)s
The y location of the text in figure coordinates.
horizontalalignment, ha : {'center', 'left', 'right'}, default: %(ha)s
The horizontal alignment of the text relative to (*x*, *y*).
verticalalignment, va : {'top', 'center', 'bottom', 'baseline'}, default: %(va)s
The vertical alignment of the text relative to (*x*, *y*).
fontsize, size : default: :rc:`figure.%(rc)ssize`
The font size of the text. See `.Text.set_size` for possible
values.
fontweight, weight : default: :rc:`figure.%(rc)sweight`
The font weight of the text. See `.Text.set_weight` for possible
values.
Returns
-------
text
The `.Text` instance of the %(name)s.
Other Parameters
----------------
fontproperties : None or dict, optional
A dict of font properties. If *fontproperties* is given the
default values for font size and weight are taken from the
`.FontProperties` defaults. :rc:`figure.%(rc)ssize` and
:rc:`figure.%(rc)sweight` are ignored in this case.
**kwargs
Additional kwargs are `matplotlib.text.Text` properties.
rWNrXÚname)r\r[r]Úx0Úy0ÚhorizontalalignmentrÚverticalalignmentÚvaršÚfontpropertiesÚfontsizeÚsizeÚ
fontweightÚweight)r¸TrS)r6r^Únormalize_kwargsrÚ
setdefaultÚmplÚrcParamsÚgetattrÚset_textÚ set_positionrjÚtextÚsetattrÚ functoolsÚpartialÚ_remove_suplabelÚ_remove_methodÚ_autoposr")r#ÚinforkrWrXÚautoposÚsuplabs r&Ú
_suplabelszFigureBase._suplabels6ðR
J‰Js˜ Ø J‰Js˜ !ˆØ ‰<Ð ˜4i‰GØ
&‰\˜
˜4iˆGØ ˆ9ØT‘
ˆ ˆT
ˆ×´Ó5ˆØ×Ñаd±Ô×ÑÐ-¨t°D©zÔ×ј* d¨:Ñ&6Ô   × Ñ ˜j¬#¯,©,°t¸F±|Ñ*DÔ × Ñ ˜l¬C¯L©L¸¸h¹Ñ,HÔ ˜˜t F™|ÓØ Ð Ø O‰O˜AÔ Ø × Ñ   Ô ˆFJ‰JÑ ˜Ó àT—YY˜q ! 1¨&Ñ1ˆ D˜$˜v™,¨Ô /Ü$-×$5Ñ$5°d×6KÑ6KØ;?À¹<ô%Iˆ "ˆŒØˆŒ
؈
r(cóT|jj|«t||d«yr,)rer9)r#rr¸s r&zFigureBase._remove_suplabels Ø
×ј%Ô Üd˜DÕ!r(çà?ç\Âõ(\ï?z super titleÚcenterÚtoprY)r¸rÚrcc ó@ddddddddd œ}|j||fi|¤ŽS)
Nr[r×rzfigure.titlesizezfigure.titleweight©r¸r©©r#rks r&ÚsuptitlezFigureBase.suptitle†s:ð
$¨3°dØ e¸Ø*Ð6JñLˆðˆt˜q 1¨&Ñ1r(cóB|j}|dS|j«S)z<Return the suptitle as string or an empty string if not set.r‰)r[Úget_text©r#Útext_objs r&Ú get_suptitlezFigureBase.get_suptitles$à—>>ˆØÐ%ˆ>¨8×+<Ñ+<Ó+>Ð>r(ç{®Gáz„?z super xlabelrŠrc ó@ddddddddd œ}|j||fi|¤ŽS)
Nr\r×rúfigure.labelsizeúfigure.labelweightrÝs r&Ú supxlabelzFigureBase.supxlabel•s:ð
%¨C°tØ h¸AØ*Ð6JñLˆðˆt˜q 1¨&Ñ1r(cóB|j}|dS|j«S)z=Return the supxlabel as string or an empty string if not set.r‰)r\s r&Ú
get_supxlabelzFigureBase.get_supxlabelŸó$à—?ØÐ%ˆ>¨8×+<Ñ+<Ó+>Ð>r(ç{®Gáz”?z super ylabelÚleftc
óBddddddddd d
œ }|j||fi|¤ŽS) Nr]r×ÚverticalÚanchorrè) r¸rÚ
rotation_moderÀs r&Ú supylabelzFigureBase.supylabel¤s<ð
%¨D¸Ø H¸*Ø!)Ð3EØ0ˆðˆt˜q 1¨&Ñ1r(cóB|j}|dS|j«S)z=Return the supylabel as string or an empty string if not set.r‰)r]s r&Ú
get_supylabelzFigureBase.get_supylabel¯r(có6|jj«S)z+Get the edge color of the Figure rectangle.)rxÚ
get_edgecolorr1s r&zFigureBase.get_edgecolor´óàz‰z×)r(có6|jj«S)z+Get the face color of the Figure rectangle.)rxÚ
get_facecolorr1s r&zFigureBase.get_facecolor¸r(có6|jj«S)
Return the figure's background patch visibility, i.e.
whether the figure background will be drawn. Equivalent to
``Figure.patch.get_visible()``.
)rxÚ get_visibler1s r&Ú get_frameonzFigureBase.get_frameon¼sð z‰z×'r(có:|jj|«y)z
Set the line width of the Figure rectangle.
Parameters
----------
linewidth : number
N)rxÚ
set_linewidth)r#Ú linewidths r&rzFigureBase.set_linewidthÄsð
× Ñ  Õ+r(có6|jj«S)z=
Get the line width of the Figure rectangle.
)rxÚ
get_linewidthr1s r&rzFigureBase.get_linewidthÎsðz‰z×)r(có:|jj|«y)z…
Set the edge color of the Figure rectangle.
Parameters
----------
color : :mpltype:`color`
N)rxÚ
set_edgecolor©r#Úcolors r&rzFigureBase.set_edgecolorÔóð
× Ñ  Õ'r(có:|jj|«y)z…
Set the face color of the Figure rectangle.
Parameters
----------
color : :mpltype:`color`
N)rxÚ
set_facecolorrs r&r
zFigureBase.set_facecolorÞrr(cóH|jj|«d|_y)
Set the figure's background patch visibility, i.e.
whether the figure background will be drawn. Equivalent to
``Figure.patch.set_visible()``.
Parameters
----------
b : bool
TN)rxr•r")r#Úbs r&Ú set_frameonzFigureBase.set_frameonèsð
×јˆ
r(FcóR|j|«|jj|«|jj|_|j «s|j
|j«|r+|j«|j|j«d|_ |S)
Add an `.Artist` to the figure.
Usually artists are added to `~.axes.Axes` objects using
`.Axes.add_artist`; this method can be used in the rare cases where
one needs to add artists directly to the figure instead.
Parameters
----------
artist : `~matplotlib.artist.Artist`
The artist to add to the figure. If the added artist has no
transform previously set, its transform will be set to
``figure.transSubfigure``.
clip : bool, default: False
Whether the added artist should be clipped by the figure patch.
Returns
-------
`~matplotlib.artist.Artist`
The added artist.
T) rbÚappendr9Úis_transform_setÚ
set_transformÚtransSubfigureÚ
get_clip_pathÚ
set_clip_pathrxr")r#rqÚclips r&Ú
add_artistzFigureBase.add_artist÷s…ð, ×ј$ÔØ ×јFÔ#Ø $§ ¡ × 3Ñ 3ˆÔà× × Ñ  ×!4Ñ!4Ô  × Ñ  §¡Ô ˆŒ
؈
r(cóBt|«sd|vr td«d|vr(t|«r td«|jd«f}t|«dk7r tjddt|««t |dt «r/|\}|j}|jd¬«|urctd «|\}tj|«j«std
|«|jd i|¤Ž\}}|||fi|¤Ž}||f}|j||«S) ad
Add an `~.axes.Axes` to the figure.
Call signatures::
add_axes(rect, projection=None, polar=False, **kwargs)
add_axes(ax)
Parameters
----------
rect : tuple (left, bottom, width, height)
The dimensions (left, bottom, width, height) of the new
`~.axes.Axes`. All quantities are in fractions of figure width and
height.
projection : {None, 'aitoff', 'hammer', 'lambert', 'mollweide', 'polar', 'rectilinear', str}, optional
The projection type of the `~.axes.Axes`. *str* is the name of
a custom projection, see `~matplotlib.projections`. The default
None results in a 'rectilinear' projection.
polar : bool, default: False
If True, equivalent to projection='polar'.
axes_class : subclass type of `~.axes.Axes`, optional
The `.axes.Axes` subclass that is instantiated. This parameter
is incompatible with *projection* and *polar*. See
:ref:`axisartist_users-guide-index` for examples.
sharex, sharey : `~matplotlib.axes.Axes`, optional
Share the x or y `~matplotlib.axis` with sharex and/or sharey.
The axis will have the same limits, ticks, and scale as the axis
of the shared Axes.
label : str
A label for the returned Axes.
Returns
-------
`~.axes.Axes`, or a subclass of `~.axes.Axes`
The returned Axes class depends on the projection used. It is
`~.axes.Axes` if rectilinear projection is used and
`.projections.polar.PolarAxes` if polar projection is used.
Other Parameters
----------------
**kwargs
This method also takes the keyword arguments for
the returned Axes class. The keyword arguments for the
rectilinear Axes class `~.axes.Axes` can be found in
the following table but there might also be other keyword
arguments if another projection is used, see the actual Axes
class.
%(Axes:kwdoc)s
Notes
-----
In rare circumstances, `.add_axes` may be called with a single
argument, an Axes instance already created in the present figure but
not in the figure's list of Axes.
See Also
--------
.Figure.add_subplot
.pyplot.subplot
.pyplot.axes
.Figure.subplots
.pyplot.subplots
Examples
--------
Some simple examples::
rect = l, b, w, h
fig = plt.figure()
fig.add_axes(rect)
fig.add_axes(rect, frameon=False, facecolor='g')
fig.add_axes(rect, polar=True)
ax = fig.add_axes(rect, projection='polar')
fig.delaxes(ax)
fig.add_axes(ax)
Úrectz9add_axes() missing 1 required positional argument: 'rect'z2add_axes() got multiple values for argument 'rect'rˆÚadd_axesrFrú5The Axes must have been created in the present figurez'all entries in rect must be finite not rS)rÚ TypeErrorr6rÚ nargs_errorÚ
isinstancerÚ_projection_initr!r;ÚnpÚisfiniterÚ _process_projection_requirementsÚ_add_axes_internal)r#Úargsrkr8rArÚprojection_classÚpkws r&rzFigureBase.add_axess0ôl4Œy˜V¨6ÑÐ

Ü4ŒyÜÐ TÓ—JJ˜)ˆ ˆt9˜Š>Ü×" :¨q´#°d³)Ó d˜1gœtÔ ‰BˆAØ×$ˆ|‰| ˆ'¨tÑ ØMðMð‰EˆDÜ—;‘;˜tÓ Ð#JÈ4È&Ð!QÓRØ$I D×$IÑ$IÑ$SÈFÑ$SÑ ˜!  3¨sÑ3ˆ# )ˆ×& q¨#Ó.r(c ó^d|vrtjdd«t|«dk(rtt|dtj
j j«rC|dj«r0|d}|j}|jd¬«|urtd«|sd}t|«dk(rIt|dt«r6d |dcxkrd
kr(nn%tttt!|d«««}|j"d i|¤Ž\}}||g|¢­i|¤Ž}||f}|j%||«S) aw
Add an `~.axes.Axes` to the figure as part of a subplot arrangement.
Call signatures::
add_subplot(nrows, ncols, index, **kwargs)
add_subplot(pos, **kwargs)
add_subplot(ax)
add_subplot()
Parameters
----------
*args : int, (int, int, *index*), or `.SubplotSpec`, default: (1, 1, 1)
The position of the subplot described by one of
- Three integers (*nrows*, *ncols*, *index*). The subplot will
take the *index* position on a grid with *nrows* rows and
*ncols* columns. *index* starts at 1 in the upper left corner
and increases to the right. *index* can also be a two-tuple
specifying the (*first*, *last*) indices (1-based, and including
*last*) of the subplot, e.g., ``fig.add_subplot(3, 1, (1, 2))``
makes a subplot that spans the upper 2/3 of the figure.
- A 3-digit integer. The digits are interpreted as if given
separately as three single-digit integers, i.e.
``fig.add_subplot(235)`` is the same as
``fig.add_subplot(2, 3, 5)``. Note that this can only be used
if there are no more than 9 subplots.
- A `.SubplotSpec`.
In rare circumstances, `.add_subplot` may be called with a single
argument, a subplot Axes instance already created in the
present figure but not in the figure's list of Axes.
projection : {None, 'aitoff', 'hammer', 'lambert', 'mollweide', 'polar', 'rectilinear', str}, optional
The projection type of the subplot (`~.axes.Axes`). *str* is the
name of a custom projection, see `~matplotlib.projections`. The
default None results in a 'rectilinear' projection.
polar : bool, default: False
If True, equivalent to projection='polar'.
axes_class : subclass type of `~.axes.Axes`, optional
The `.axes.Axes` subclass that is instantiated. This parameter
is incompatible with *projection* and *polar*. See
:ref:`axisartist_users-guide-index` for examples.
sharex, sharey : `~matplotlib.axes.Axes`, optional
Share the x or y `~matplotlib.axis` with sharex and/or sharey.
The axis will have the same limits, ticks, and scale as the axis
of the shared Axes.
label : str
A label for the returned Axes.
Returns
-------
`~.axes.Axes`
The Axes of the subplot. The returned Axes can actually be an
instance of a subclass, such as `.projections.polar.PolarAxes` for
polar projections.
Other Parameters
----------------
**kwargs
This method also takes the keyword arguments for the returned Axes
base class; except for the *figure* argument. The keyword arguments
for the rectilinear base class `~.axes.Axes` can be found in
the following table but there might also be other keyword
arguments if another projection is used.
%(Axes:kwdoc)s
See Also
--------
.Figure.add_axes
.pyplot.subplot
.pyplot.axes
.Figure.subplots
.pyplot.subplots
Examples
--------
::
fig = plt.figure()
fig.add_subplot(231)
ax1 = fig.add_subplot(2, 3, 1) # equivalent but more general
fig.add_subplot(232, frameon=False) # subplot with no frame
fig.add_subplot(233, projection='polar') # polar subplot
fig.add_subplot(234, sharex=ax1) # subplot sharing x-axis with ax1
fig.add_subplot(235, facecolor="red") # red subplot
ax1.remove() # delete ax1 from the figure
fig.add_subplot(ax1) # add ax1 back to the figure
ÚfigureÚ add_subplotrˆrFrr)rˆrˆrˆédrS)rÚ kwarg_errorrrrÚ_baseÚ _AxesBaser‡rr!r;rÚtupleÚmapÚintÚstrr!r")r#r#rkr}rAr$r%s r&r(zFigureBase.add_subplots,ðJ  ô×" =°(Ó ŠNܘt A™w¬¯©¯©×(@Ñ(@Ô˜‘G×a‘ˆBØ×%ˆCØ}‰} %ˆÑ ð"6óØ ôD“ ˜Q’¤:¨d°1©g´xÔ#@ؘt A™wÔ-¨#ÕœS¤¤c¨$¨q©'£lÓ4Ø$I D×$IÑ$IÑ$SÈFÑ$SÑ ˜! ÒÑ5ˆ# )ˆ×& r¨3Ó/r(có|jj|«||jvr|jj|«|j |«|j
|_||_d|_t|_
|S)z0Private helper for `add_axes` and `add_subplot`.T) Ú_axstackr?rarÚscaÚdelaxesrÏrr"r'Ústale_callback)r#r}rAs r&r"zFigureBase._add_axes_internal seà
×јØ
T—_ O‰O× "   Œ Ø ŸL™LˆÔàÔØˆŒ
ÜÔØˆ r()ÚsharexÚshareyÚsqueezeÚ width_ratiosÚ
height_ratiosÚ
subplot_kwÚ gridspec_kwcóÒt| xsi«} |d| vr td«|| d<|d| vr td«|| d<|j||fd|i| ¤Ž}
|
j||||¬«} | S)ab
Add a set of subplots to this figure.
This utility wrapper makes it convenient to create common layouts of
subplots in a single call.
Parameters
----------
nrows, ncols : int, default: 1
Number of rows/columns of the subplot grid.
sharex, sharey : bool or {'none', 'all', 'row', 'col'}, default: False
Controls sharing of x-axis (*sharex*) or y-axis (*sharey*):
- True or 'all': x- or y-axis will be shared among all subplots.
- False or 'none': each subplot x- or y-axis will be independent.
- 'row': each subplot row will share an x- or y-axis.
- 'col': each subplot column will share an x- or y-axis.
When subplots have a shared x-axis along a column, only the x tick
labels of the bottom subplot are created. Similarly, when subplots
have a shared y-axis along a row, only the y tick labels of the
first column subplot are created. To later turn other subplots'
ticklabels on, use `~matplotlib.axes.Axes.tick_params`.
When subplots have a shared axis that has units, calling
`.Axis.set_units` will update each axis with the new units.
Note that it is not possible to unshare axes.
squeeze : bool, default: True
- If True, extra dimensions are squeezed out from the returned
array of Axes:
- if only one subplot is constructed (nrows=ncols=1), the
resulting single Axes object is returned as a scalar.
- for Nx1 or 1xM subplots, the returned object is a 1D numpy
object array of Axes objects.
- for NxM, subplots with N>1 and M>1 are returned as a 2D array.
- If False, no squeezing at all is done: the returned Axes object
is always a 2D array containing Axes instances, even if it ends
up being 1x1.
width_ratios : array-like of length *ncols*, optional
Defines the relative widths of the columns. Each column gets a
relative width of ``width_ratios[i] / sum(width_ratios)``.
If not given, all columns will have the same width. Equivalent
to ``gridspec_kw={'width_ratios': [...]}``.
height_ratios : array-like of length *nrows*, optional
Defines the relative heights of the rows. Each row gets a
relative height of ``height_ratios[i] / sum(height_ratios)``.
If not given, all rows will have the same height. Equivalent
to ``gridspec_kw={'height_ratios': [...]}``.
subplot_kw : dict, optional
Dict with keywords passed to the `.Figure.add_subplot` call used to
create each subplot.
gridspec_kw : dict, optional
Dict with keywords passed to the
`~matplotlib.gridspec.GridSpec` constructor used to create
the grid the subplots are placed on.
Returns
-------
`~.axes.Axes` or array of Axes
Either a single `~matplotlib.axes.Axes` object or an array of Axes
objects if more than one subplot was created. The dimensions of the
resulting array can be controlled with the *squeeze* keyword, see
above.
See Also
--------
.pyplot.subplots
.Figure.add_subplot
.pyplot.subplot
Examples
--------
::
# First create some toy data:
x = np.linspace(0, 2*np.pi, 400)
y = np.sin(x**2)
# Create a figure
fig = plt.figure()
# Create a subplot
ax = fig.subplots()
ax.plot(x, y)
ax.set_title('Simple plot')
# Create two subplots and unpack the output array immediately
ax1, ax2 = fig.subplots(1, 2, sharey=True)
ax1.plot(x, y)
ax1.set_title('Sharing Y axis')
ax2.scatter(x, y)
# Create four polar Axes and access them through the returned array
axes = fig.subplots(2, 2, subplot_kw=dict(projection='polar'))
axes[0, 0].plot(x, y)
axes[1, 1].scatter(x, y)
# Share an X-axis with each column of subplots
fig.subplots(2, 2, sharex='col')
# Share a Y-axis with each row of subplots
fig.subplots(2, 2, sharey='row')
# Share both X- and Y-axes with all subplots
fig.subplots(2, 2, sharex='all', sharey='all')
# Note that this is the same as
fig.subplots(2, 2, sharex=True, sharey=True)
r:úQ'height_ratios' must not be defined both as parameter and as key in 'gridspec_kw'r9úP'width_ratios' must not be defined both as parameter and as key in 'gridspec_kw'r')r6r7r8r;)Údictr;Ú add_gridspecÚsubplots) r#ÚnrowsÚncolsr6r7r8r9r:r;r<ÚgsÚaxss r&rBzFigureBase.subplotss­ôr˜,¨"Ó Ø Ð   ð"IóJðJà+8ˆÑ Ð  Ñ ð"IóJðJà*6ˆK˜Ñ
ˆT×
Ñ
˜u 
H°DÐ
H¸
Øk‰k °ÀØ%/ðóàˆ
r(cóV|j||j|jg¬«y)zY
Remove the `~.axes.Axes` *ax* from the figure; update the current Axes.
)ÚownersN)Ú _remove_axesr2ra©r#r}s r&r4zFigureBase.delaxes¢s$ð
×ј" d§m¡m°T·_±_Ð%EÐÕFr(cóÎ|D]}|j|«Œ|jjd|«d|_|jj
j
|«|jD}|j|}|j|«Dcgc] }||usŒ|Œ }}|sŒ8|j|«|dj|}|j«j|«|j«j|«|j«j|«|j«j|«ŒØ|j j|«ycc}w)aD
Common helper for removal of standard Axes (via delaxes) and of child Axes.
Parameters
----------
ax : `~.AxesBase`
The Axes to remove.
owners
List of objects (list or _AxesStack) "owning" the Axes, from which the Axes
will be remove()d.
Ú_axes_change_eventTrN)r9Ú _axobserversÚprocessr"ÚcanvasÚ
release_mouseÚ _axis_namesÚ _shared_axesÚ get_siblingsÚ _axis_mapÚget_major_formatterÚset_axisÚget_major_locatorÚget_minor_formatterÚget_minor_locatorÚ
_twinned_axes) r#r}rHÚownerr¸ÚgrouperÚotherÚsiblingsÚremaining_axiss r&rIzFigureBase._remove_axes¨sAðò ˆEØ L‰L˜Õ ð ð
×Ñ×!Ð"6¸ÔˆŒ
Ø ×Ñ× Ñ ×.¨rÔ—N‘Nò
Hˆ—oo +ˆGØ+2×+?Ñ+?ÀÓ+CÖW %ÀuÐTVšÐWˆHÐØØ N‰N˜ ð& a™[×2°4Ñ8ˆ × 9¸.Ô × Ô × 9¸.Ô × Õ 
Hð ×Ñ×Ñ Õ#ùòXs  E"ÂE"cóžd|_|jD]}|j|¬«Œg|_t|j«D]#}|j«|j |«Œ%g|_g|_g|_g|_ g|_
g|_ |stj«|_d|_d|_d|_d|_y)
Clear the figure.
Parameters
----------
keep_observers : bool, default: False
Set *keep_observers* to True if, for example,
a gui widget is tracking the Axes in the figure.
Úkeep_observersT)rirhÚclearr-rr4rbrcrdrerfrgr^ÚCallbackRegistryrMr[r\r]r")r#rbÚsubfigr}s r&rczFigureBase.clearÌs¿ð"&ˆÔð—l 8ˆFØ L‰L¨ˆLÕ ˆŒ 䘟 ™ Ó ˆ H‰HŒJØ L‰L˜Õ ð ðˆŒ ØˆŒ
؈Œ ؈Œ
؈Œ ؈Œ ÙÜ %× 6Ñ 6Ó 8ˆDÔ ØˆŒØˆŒØˆŒàˆ
r(có&|j|¬«S)a}
[*Discouraged*] Alias for the `clear()` method.
.. admonition:: Discouraged
The use of ``clf()`` is discouraged. Use ``clear()`` instead.
Parameters
----------
keep_observers : bool, default: False
Set *keep_observers* to True if, for example,
a gui widget is tracking the Axes in the figure.
ra)rc)r#rbs r&ÚclfzFigureBase.clfðsðz‰z¨ˆ8r(có6tj|jg|¢­i|¤Ž\}}}|jd|j«tj
|||fi|¤Ž}|j j|«|j j|_ d|_
|S)a4
Place a legend on the figure.
Call signatures::
legend()
legend(handles, labels)
legend(handles=handles)
legend(labels)
The call signatures correspond to the following different ways to use
this method:
**1. Automatic detection of elements to be shown in the legend**
The elements to be added to the legend are automatically determined,
when you do not pass in any extra arguments.
In this case, the labels are taken from the artist. You can specify
them either at artist creation or by calling the
:meth:`~.Artist.set_label` method on the artist::
ax.plot([1, 2, 3], label='Inline label')
fig.legend()
or::
line, = ax.plot([1, 2, 3])
line.set_label('Label via method')
fig.legend()
Specific lines can be excluded from the automatic legend element
selection by defining a label starting with an underscore.
This is default for all artists, so calling `.Figure.legend` without
any arguments and without setting the labels manually will result in
no legend being drawn.
**2. Explicitly listing the artists and labels in the legend**
For full control of which artists have a legend entry, it is possible
to pass an iterable of legend artists followed by an iterable of
legend labels respectively::
fig.legend([line1, line2, line3], ['label1', 'label2', 'label3'])
**3. Explicitly listing the artists in the legend**
This is similar to 2, but the labels are taken from the artists'
label properties. Example::
line1, = ax1.plot([1, 2, 3], label='label1')
line2, = ax2.plot([1, 2, 3], label='label2')
fig.legend(handles=[line1, line2])
**4. Labeling existing plot elements**
.. admonition:: Discouraged
This call signature is discouraged, because the relation between
plot elements and labels is only implicit by their order and can
easily be mixed up.
To make a legend for all artists on all Axes, call this function with
an iterable of strings, one for each legend item. For example::
fig, (ax1, ax2) = plt.subplots(1, 2)
ax1.plot([1, 3, 5], color='blue')
ax2.plot([2, 4, 6], color='red')
fig.legend(['the blues', 'the reds'])
Parameters
----------
handles : list of `.Artist`, optional
A list of Artists (lines, patches) to be added to the legend.
Use this together with *labels*, if you need full control on what
is shown in the legend and the automatic mechanism described above
is not sufficient.
The length of handles and labels should be the same in this
case. If they are not, they are truncated to the smaller length.
labels : list of str, optional
A list of labels to show next to the artists.
Use this together with *handles*, if you need full control on what
is shown in the legend and the automatic mechanism described above
is not sufficient.
Returns
-------
`~matplotlib.legend.Legend`
Other Parameters
----------------
%(_legend_kw_figure)s
See Also
--------
.Axes.legend
Notes
-----
Some artists are not supported by this function. See
:ref:`legend_guide` for details.
Úbbox_transformT) ÚmlegendÚ_parse_legend_argsrrÚLegendrgrr9r")r#r#rkÚhandlesÚlabelsÚls r&ÚlegendzFigureBase.legends‰ô^#*×"<Ñ"<¸T¿Y¹YÐ"XÈÒ"XÐQWÑ"Xш˜à×ÑÐ*¨D×,?Ñ,?Ô N‰N˜4 ¨&Ñ ;°FÑ Ø ×јAÔØŸ<™<×.ˆÔ؈Œ
؈r(c ód|ji||ni¥|¥}td|||dœ|¤Ž}|j|«t|_|j
j
|«|j
j|_d|_ |S)a—
Add text to figure.
Parameters
----------
x, y : float
The position to place the text. By default, this is in figure
coordinates, floats in [0, 1]. The coordinate system can be changed
using the *transform* keyword.
s : str
The text string.
fontdict : dict, optional
A dictionary to override the default text properties. If not given,
the defaults are determined by :rc:`font.*`. Properties passed as
*kwargs* override the corresponding ones given in *fontdict*.
Returns
-------
`~.text.Text`
Other Parameters
----------------
**kwargs : `~matplotlib.text.Text` properties
Other miscellaneous text parameters.
%(Text:kwdoc)s
See Also
--------
.Axes.text
.pyplot.text
Ú transform)rWrXTrS)
rrr'r5rerr9r")r#rWrXÚfontdictrkÚeffective_kwargsrÊs r&zFigureBase.text~ðJ
˜×
à/‰x°Rð
ðð
Ðô
Ð9a˜1 1Ñ9Ð(8ÑØ ˜ÔÜÔà
×ј$ÔØ"Ÿj™j×ÔØˆŒ
؈ r(c
ó$|
t|dd«}|€8| td«t|tj«rg|j
¢ntj |«rg|¢n|gdjd¬«}|j«}|j«|j«jsd}|rXt|tjjj«r*|j«rt!j"|fi|¤Ž\}}nt!j$|fi|¤Ž\}}|j'|«|j)ddd¬«t+|d «rZ|jd
¬«x}F||j,ur8t/j0d t3|«d t3|j,«d
«gd¢} t!j4||fi|j7«D
cic]
\}
} |
| vsŒ |
| Œc} }
¤Ž} d
|jd¬«_| Scc} }
w)aP
Add a colorbar to a plot.
Parameters
----------
mappable
The `matplotlib.cm.ScalarMappable` (i.e., `.AxesImage`,
`.ContourSet`, etc.) described by this colorbar. This argument is
mandatory for the `.Figure.colorbar` method but optional for the
`.pyplot.colorbar` function, which sets the default to the current
image.
Note that one can create a `.ScalarMappable` "on-the-fly" to
generate colorbars not attached to a previously drawn artist, e.g.
::
fig.colorbar(cm.ScalarMappable(norm=norm, cmap=cmap), ax=ax)
cax : `~matplotlib.axes.Axes`, optional
Axes into which the colorbar will be drawn. If `None`, then a new
Axes is created and the space for it will be stolen from the Axes(s)
specified in *ax*.
ax : `~matplotlib.axes.Axes` or iterable or `numpy.ndarray` of Axes, optional
The one or more parent Axes from which space for a new colorbar Axes
will be stolen. This parameter is only used if *cax* is not set.
Defaults to the Axes that contains the mappable used to create the
colorbar.
use_gridspec : bool, optional
If *cax* is ``None``, a new *cax* is created as an instance of
Axes. If *ax* is positioned with a subplotspec and *use_gridspec*
is ``True``, then *cax* is also positioned with a subplotspec.
Returns
-------
colorbar : `~matplotlib.colorbar.Colorbar`
Other Parameters
----------------
%(_make_axes_kw_doc)s
%(_colormap_kw_doc)s
Notes
-----
If *mappable* is a `~.contour.ContourSet`, its *extend* kwarg is
included automatically.
The *shrink* kwarg provides a simple way to scale the colorbar with
respect to the Axes. Note that if *cax* is specified, it determines the
size of the colorbar, and *shrink* and *aspect* are ignored.
For more precise control, you can manually specify the positions of the
axes objects in which the mappable and the colorbar are drawn. In this
case, do not use any of the Axes properties kwargs.
It is known that some vector graphics viewers (svg and pdf) render
white gaps between segments of the colorbar. This is due to bugs in
the viewers, not Matplotlib. As a workaround, the colorbar can be
rendered with overlapping segments::
cbar = colorbar()
cbar.solids.set_edgecolor("face")
draw()
However, this has negative consequences in other circumstances, e.g.
with semi-transparent images (alpha < 1) and colorbar extensions;
therefore, this workaround is not used by default (see issue #1188).
NrzÌUnable to determine Axes to steal space for Colorbar. Either provide the *cax* argument to use as the Axes for the Colorbar, provide the *ax* argument to steal space from it, or add *mappable* to an Axes.rFrr„)Úvisibler…Úaxisr!Tz&Adding colorbar to a different Figure z than z! which fig.colorbar is called on.)ÚfractionÚpadÚshrinkÚaspectròÚpanchor)r;rrÚndarrayÚflatÚiterabler!Úgcar—Úcolorbar_gridspecrÅrr+r,r‡ÚcbarÚmake_axes_gridspecÚ make_axesr3Úgridr{rÚ
warn_externalÚreprÚColorbarÚitemsr")
r#ÚmappableÚcaxr}Ú use_gridspecrkr%Ú
current_axÚmappable_host_figÚNON_COLORBAR_KEYSÚcbs
r&ÚcolorbarzFigureBase.colorbar°ðV ˆ:ܘ 6¨4Ó0ˆBà ‰;؈zÜ ð ¬R¯Z©ZÔ8
"—''
Ü Ÿk™k¨"œoUrT˜÷)™j¨e˜jÓ
ðŸˆJØ××/×$ ÙÜ" 2¤s§x¡x§~¡~×'?Ñ'?Ô×"×5°bÑC¸C "Ÿn™n¨RÑ:°6Ñ:  G‰G Ø H‰H˜U¨&°vˆ H˜ +Ø&.×&9Ñ&9¸tÐ&9Ó&DÐ ¨×(9Ñ(9Ñ×Ð 1Ó3°6Ü × 1Ñ 1Ó45ð HÐä
]‰]˜3 ñLØ#Ÿ\™\-KÙQ˜¨qÐ8IÒ/IˆAˆq‰Dó-KñLˆà+/ˆ˜Óˆ ùó-Ks Ç H Ç(H cór|j«0|j«jstjd«y|jj ||||||«|j D]A}|j«Œ|j|j«j|««ŒCd|_
y)aQ
Adjust the subplot layout parameters.
Unset parameters are left unmodified; initial values are given by
:rc:`figure.subplot.[name]`.
.. plot:: _embedded_plots/figure_subplots_adjust.py
Parameters
----------
left : float, optional
The position of the left edge of the subplots,
as a fraction of the figure width.
right : float, optional
The position of the right edge of the subplots,
as a fraction of the figure width.
bottom : float, optional
The position of the bottom edge of the subplots,
as a fraction of the figure height.
top : float, optional
The position of the top edge of the subplots,
as a fraction of the figure height.
wspace : float, optional
The width of the padding between subplots,
as a fraction of the average Axes width.
hspace : float, optional
The height of the padding between subplots,
as a fraction of the average Axes height.
NzThis figure was using a layout engine that is incompatible with subplots_adjust and/or tight_layout; not calling subplots_adjust.T) r—r˜rr‡Ú subplotparsrKrr‡Ú
_set_positionÚ get_positionr")r#ÚrightrÚÚwspaceÚhspacer}s r&r™zFigureBase.subplots_adjust(ð>
× ×,× × Ñ ð

Ø ×Ñ×Ñ  f¨e°S¸&À&Ô—) Jˆ×× Ñ  ×!3Ñ!3Ó!5×!BÑ!BÀ4Ó!HÕ Jðˆ
r(có†| |j}tj|«Dcgc]}|j«Œ|Œ}}|D}tj d|j
««|j«j}|jj«}|D]—}|jj«|k(sŒ!|j«j}|dk(r|j|jk(s |dk(sŒ_|j|jk(sŒy|jdj||«Œ™Œøycc}w)
Align the xlabels of subplots in the same subplot row if label
alignment is being done automatically (i.e. the label position is
not manually set).
Alignment persists for draw events after this is called.
If a label is on the bottom, it is aligned with labels on Axes that
also have their label on the bottom and that have the same
bottom-most subplot row. If the label is on the top,
it is aligned with labels on Axes with the same top-most row.
Parameters
----------
axs : list of `~matplotlib.axes.Axes`
Optional list of (or `~numpy.ndarray`) `~matplotlib.axes.Axes`
to align the xlabels.
Default is to align all Axes on the figure.
See Also
--------
matplotlib.figure.Figure.align_ylabels
matplotlib.figure.Figure.align_titles
matplotlib.figure.Figure.align_labels
Notes
-----
This assumes that all Axes in ``axs`` are from the same `.GridSpec`,
so that their `.SubplotSpec` positions correspond to figure positions.
Examples
--------
Example with rotated xtick labels::
fig, axs = plt.subplots(1, 2)
for tick in axs[0].get_xticklabels():
tick.set_rotation(55)
axs[0].set_xlabel('XLabel 0')
axs[1].set_xlabel('XLabel 1')
fig.align_xlabels()
 Working on: %srÚrW)rrÚravelr‡Ú_logÚdebugÚ
get_xlabelÚrowspanÚxaxisÚget_label_positionÚstartÚstopr`Újoin)r#rFr}ÚposÚaxcÚrowspancs r&Ú
align_xlabelszFigureBase.align_xlabelsTsðT ˆ—)‘)ˆCÜŸH™H SNb¨R×-?Ñ-?Ó-AÑ-MŠrÐNˆÐò Dˆ J‰JÐ(¨"¯-©-«/Ô ×2ˆGØ—(‘(×/ˆCð ò
DØ—99×1°SÓ"×4×<˜ ¨¯©¸(¿.¹.Ò)HØ 8›O°· ± ÀÇ
Á
Ó0Mà×Ñ:¸2¸sÕ

Dñ DùòOó
¦D>¼D>có†| |j}tj|«Dcgc]}|j«Œ|Œ}}|D}tj d|j
««|j«j}|jj«}|D]—}|jj«|k(sŒ!|j«j}|dk(r|j|jk(s |dk(sŒ_|j|jk(sŒy|jdj||«Œ™Œøycc}w)a
Align the ylabels of subplots in the same subplot column if label
alignment is being done automatically (i.e. the label position is
not manually set).
Alignment persists for draw events after this is called.
If a label is on the left, it is aligned with labels on Axes that
also have their label on the left and that have the same
left-most subplot column. If the label is on the right,
it is aligned with labels on Axes with the same right-most column.
Parameters
----------
axs : list of `~matplotlib.axes.Axes`
Optional list (or `~numpy.ndarray`) of `~matplotlib.axes.Axes`
to align the ylabels.
Default is to align all Axes on the figure.
See Also
--------
matplotlib.figure.Figure.align_xlabels
matplotlib.figure.Figure.align_titles
matplotlib.figure.Figure.align_labels
Notes
-----
This assumes that all Axes in ``axs`` are from the same `.GridSpec`,
so that their `.SubplotSpec` positions correspond to figure positions.
Examples
--------
Example with large yticks labels::
fig, axs = plt.subplots(2, 1)
axs[0].plot(np.arange(0, 1000, 50))
axs[0].set_ylabel('YLabel 0')
axs[1].set_ylabel('YLabel 1')
fig.align_ylabels()
Nrr™rX)rrr‡r Ú
get_ylabelÚcolspanÚyaxisr¤r`)r#rFr}Úcolspancs r&Ú
align_ylabelszFigureBase.align_ylabelssðR ˆ—)‘)ˆCÜŸH™H SNb¨R×-?Ñ-?Ó-AÑ-MŠrÐNˆÐò Dˆ J‰JÐ(¨"¯-©-«/Ô ×2ˆGØ—(‘(×/ˆCð ò
DØ—99×1°SÓ"×4×<˜
¨'¯-©-¸8¿>¹>Ò*IØ 7N¨w¯|©|¸x¿}¹}Ó/Là×Ñ:¸2¸sÕ

Dñ DùòOcóÎ| |j}tj|«Dcgc]}|j«Œ|Œ}}|D}tj d|j
««|j«j}|D]U}|j«j}|j|jk(sŒ7|jdj||«ŒWŒœycc}w)aP
Align the titles of subplots in the same subplot row if title
alignment is being done automatically (i.e. the title position is
not manually set).
Alignment persists for draw events after this is called.
Parameters
----------
axs : list of `~matplotlib.axes.Axes`
Optional list of (or ndarray) `~matplotlib.axes.Axes`
to align the titles.
Default is to align all Axes on the figure.
See Also
--------
matplotlib.figure.Figure.align_xlabels
matplotlib.figure.Figure.align_ylabels
matplotlib.figure.Figure.align_labels
Notes
-----
This assumes that all Axes in ``axs`` are from the same `.GridSpec`,
so that their `.SubplotSpec` positions correspond to figure positions.
Examples
--------
Example with titles::
fig, axs = plt.subplots(1, 2)
axs[0].set_aspect('equal')
axs[0].set_title('Title 0')
axs[1].set_title('Title 1')
fig.align_titles()
NrrY) rrr‡r Ú get_titler¢r`)r#rFr}s r&Ú align_titleszFigureBase.align_titlesÏðH ˆ;Ø—)‘)ˆCÜŸH™H SNb¨R×-?Ñ-?Ó-AÑ-MŠrÐNˆÐò Dˆ J‰JÐ(¨"¯,©,«.Ô ×2ˆGØò
DØ×8Ø—M‘M X§^¡^Ó×,¨WÑ:¸2¸sÕ
Dñ DùòOs
¦C"¼C"cóL|j|¬«|j|¬«y)a€
Align the xlabels and ylabels of subplots with the same subplots
row or column (respectively) if label alignment is being
done automatically (i.e. the label position is not manually set).
Alignment persists for draw events after this is called.
Parameters
----------
axs : list of `~matplotlib.axes.Axes`
Optional list (or `~numpy.ndarray`) of `~matplotlib.axes.Axes`
to align the labels.
Default is to align all Axes on the figure.
See Also
--------
matplotlib.figure.Figure.align_xlabels
matplotlib.figure.Figure.align_ylabels
matplotlib.figure.Figure.align_titles
Notes
-----
This assumes that all Axes in ``axs`` are from the same `.GridSpec`,
so that their `.SubplotSpec` positions correspond to figure positions.
)rFN))r#rFs r&Ú align_labelszFigureBase.align_labelsþs&ð4
×јsÐÔ ×јsÐÕ#r(c óH|jdd«}td|||dœ|¤Ž}|S)aS
Low-level API for creating a `.GridSpec` that has this figure as a parent.
This is a low-level API, allowing you to create a gridspec and
subsequently add subplots based on the gridspec. Most users do
not need that freedom and should use the higher-level methods
`~.Figure.subplots` or `~.Figure.subplot_mosaic`.
Parameters
----------
nrows : int, default: 1
Number of rows in grid.
ncols : int, default: 1
Number of columns in grid.
Returns
-------
`.GridSpec`
Other Parameters
----------------
**kwargs
Keyword arguments are passed to `.GridSpec`.
See Also
--------
matplotlib.pyplot.subplots
Examples
--------
Adding a subplot that spans two rows::
fig = plt.figure()
gs = fig.add_gridspec(2, 2)
ax1 = fig.add_subplot(gs[0, 0])
ax2 = fig.add_subplot(gs[1, 0])
# spans two rows:
ax3 = fig.add_subplot(gs[:, 1])
r'N)rCrDr'rS)r6r)r#rCrDrkÚ_rEs r&rAzFigureBase.add_gridspecs0ðV
J‰Jx Ó &ˆÜ
Ð
F˜°tÑ
F¸
FˆØˆ r(c
óHt|||||||dddd¬« } tj||ft¬«}
t |«D]/} t |«D]} |j
| | | ffi|¤Ž|
| | f<Œ!Œ1|j
«€p||l| j|«\}
}}}t|
|
|«D]F\}}}t|||«D]0\}}}tj||||«}|j|¬«Œ2ŒH|r/|
jdk(r|
j«S|
j«S|
S)a*
Add a set of subfigures to this figure or subfigure.
A subfigure has the same artist methods as a figure, and is logically
the same as a figure, but cannot print itself.
See :doc:`/gallery/subplots_axes_and_figures/subfigures`.
.. versionchanged:: 3.10
subfigures are now added in row-major order.
Parameters
----------
nrows, ncols : int, default: 1
Number of rows/columns of the subfigure grid.
squeeze : bool, default: True
If True, extra dimensions are squeezed out from the returned
array of subfigures.
wspace, hspace : float, default: None
The amount of width/height reserved for space between subfigures,
expressed as a fraction of the average subfigure width/height.
If not given, the values will be inferred from rcParams if using
constrained layout (see `~.ConstrainedLayoutEngine`), or zero if
not using a layout engine.
width_ratios : array-like of length *ncols*, optional
Defines the relative widths of the columns. Each column gets a
relative width of ``width_ratios[i] / sum(width_ratios)``.
If not given, all columns will have the same width.
height_ratios : array-like of length *nrows*, optional
Defines the relative heights of the rows. Each row gets a
relative height of ``height_ratios[i] / sum(height_ratios)``.
If not given, all rows will have the same height.
rrˆ) rCrDr'rr9r:r™©Údtyper´)rrÚemptyÚobjectÚrangeÚ
add_subfigurer—Úget_grid_positionsÚziprÚ from_extentsÚ_redo_transform_rel_figrÀÚitemr8)r#rCrDr8rr9r:rkrEÚsfarrÚbottomsÚtopsÚleftsÚrightsÚsfrowrŠÚsfrïr™s r&Ú
subfigureszFigureBase.subfiguresJsZôP˜°tØ#¨FØ#/Ø$1Ø A¨a°Qô ô ˜% ˜¬vÔÜu“ò EˆAܘ5“\ò
EØ0˜d×°A°q°D±ÑD¸VÑDd’ ñ
Eð Eð × Ð1CØ17Ð1Cð,.×+@Ñ+@ÀÓ+FÑ (ˆGT˜5 &Ü&)¨%°¸$Ó&?ò
"v˜sÜ'*¨5°%¸Ó'@ò:OB˜˜×,¨T°6¸5À#ÓF×.°DÐ
ð$)§:¡:°¢?5—::“<Ð G¸¿
¹
»Ð ˆLr(c ó¦t||fi|¤Ž}|xj|gz
c_|jj|_t|_d|_|S)
Add a `.SubFigure` to the figure as part of a subplot arrangement.
Parameters
----------
subplotspec : `.gridspec.SubplotSpec`
Defines the region in a parent gridspec where the subfigure will
be placed.
Returns
-------
`.SubFigure`
Other Parameters
----------------
**kwargs
Are passed to the `.SubFigure` object.
See Also
--------
.Figure.subfigures
T)Ú SubFigurerhr9r'r5r")r#Ú subplotspecrks r&zFigureBase.add_subfiguresKô.t˜
3¨FÑ
Ø Š ˜˜Ñ Ø ŸL™L×ÔÜÔØˆŒ
؈ r(cót|jj|«|jjd|«|S)z.Set the current Axes to be *a* and return *a*.rL)r2r=rMrNr7s r&r3zFigureBase.sca­s0à
×јQÔØ ×Ñ×!Ð"6¸Ôˆr(có^|jj«}||S|j«S)
Get the current Axes.
If there is currently no Axes on this Figure, a new one is created
using `.Figure.add_subplot`. (To test whether there is currently an
Axes on a Figure, check whether ``figure.axes`` is empty. To test
whether there is currently a Figure on the pyplot figure stack, check
whether `.pyplot.get_fignums()` is empty.)
)r2rEr(rJs r&rzFigureBase.gca³s.ð]‰]×
$ˆØ^ˆ×)9Ñ)9Ó);Ð;r(cóÆ|jj«}|y|j«}||St|j«D]}|j«}|Œ|cSy)a>
Get the current colorable artist.
Specifically, returns the current `.ScalarMappable` instance (`.Image`
created by `imshow` or `figimage`, `.Collection` created by `pcolor` or
`scatter`, etc.), or *None* if no such instance has been defined.
The current image is an attribute of the current Axes, or the nearest
earlier Axes in the current figure that contains an image.
Notes
-----
Historically, the only colorable artists were images; hence the name
``gci`` (get current image).
N)r2rEÚ_gciÚreversedr)r#r}Úims r&zFigureBase._gciÀsgð$]‰]×
$ˆØ
ˆØ
W‰WYˆØ
ˆ>؈˜4Ÿ9™9Ó ˆB؈B؉~Ø’ ð ðr()Ú
axes_classÚpolarÚ
projectionc óF||s| td«|}||fS|r||dk7rtd|d|d«d}t|t«s|tj|«}||fSt |d«r)|j
«\}}|jdi|¤Ž||fStd|«) zÊ
Handle the args/kwargs to add_axes/add_subplot/gca, returning::
(axes_proj_class, proj_class_kwargs)
which can be used for new Axes initialization/identification.
z7Cannot combine 'axes_class' and 'projection' or 'polar'rÚzpolar=z, yet projection=z1. Only one of these arguments should be supplied.Ú _as_mpl_axeszJprojection must be a string, None or implement a _as_mpl_axes method, not rS) r;rr0rÚget_projection_classr{rKr)r#rkr$Ú extra_kwargss r&r!z+FigureBase._process_projection_requirementsásð Ð ˜
Ð ØOðOà ð(  Ð'ñ#ØÐ)¨j¸GÒ.CÜ   Ð'8¸¸ðGJðJóðð%
ä˜*¤cÔ*¨jÐ.@Ü#.×#CÑ#CÀJÓ#OÐ ð  Ð˜ 4Ø1;×1HÑ1HÓ1JÑ  
Ñ-  Ò
  Ð ð0Ø0:¨~ð@ð@r(có |j«Dcgc]$}|j«r|j«r|Œ&}}|jD]2}|j«sŒ|j |j ««Œ4|Scc}w)zU
Return a list of Artists typically used in `.Figure.get_tightbbox`.
)rwÚ
get_in_layoutrÚextendÚget_default_bbox_extra_artists)r#rqÚ bbox_artistsr}s r&z)FigureBase.get_default_bbox_extra_artistss‡ð.2×->Ñ->Ó-@öN "×0°V×5IÑ5IÔ5KòðNˆ ðNà—)‘)ò IˆBØ~‰~ÕØ×# B×$EÑ$EÓ$GÕ IðÐùò Ns“)B©Úbbox_extra_artistscóà|€ |jd¬«j«}g}|€L|j«Dcgc]2}||jvr"|j «r|j «r|Œ4}}n|}|D]'}|j
|«}|Œ|j|«Œ)|jD]8}|j «sŒ |j
||¬«}|j|«Œ:|D cgc]`} tj| j«r?tj| j«r | jdk7s| jdk7r| Œb}} t|d«}
t|«dk(r|
r |jS|j g}t#j$|«} |
r$t'| |j(j+««} | Scc}w#t$r|j
|«}YŒwxYwcc} w)aF
Return a (tight) bounding box of the figure *in inches*.
Note that `.FigureBase` differs from all other artists, which return
their `.Bbox` in pixels.
Artists that have ``artist.set_in_layout(False)`` are not included
in the bbox.
Parameters
----------
renderer : `.RendererBase` subclass
Renderer that will be used to draw the figures (i.e.
``fig.canvas.get_renderer()``)
bbox_extra_artists : list of `.Artist` or ``None``
List of artists to include in the tight bounding box. If
``None`` (default), then all artist children of each Axes are
included in the tight bounding box.
Returns
-------
`.BboxBase`
containing the bounding box (in figure inches).
TrrÚ bbox_inches)r!rrwrÚ
get_tightbboxrrrr ÚwidthÚheightr{rrÚunionrÚdpi_scale_transÚinverted) r#r|Úbbrqrbr8r}r ÚisfigureÚ_bboxs r&zFigureBase.get_tightbboxð6 РبDÓAˆHà
ˆØ Ð %Ø,0×,=Ñ,=Ó,?ö8 ¯©Ñ2°v×7IÑ7IÔ7KØð8ˆGñ)ˆGàò ˆAØ—?‘? 8Ó,ˆDØÑØ— ‘ ˜$•ð ð
—)‘)ò ˆBØ~‰~Õð× Ð5GðI— ‘ ˜$•ð ðö8—++˜aŸg™gÔ&¬2¯;©;°q·x±xÔ+@Ø—ww !’| q§x¡x°1¢}òðð˜4 ÓÜ ˆr7aŠ<ÙØ×—ii[ä
˜2“ˆá ä# E¨4×+?Ñ+?×+HÑ+HÓ+JÓKˆˆ ùòO8øô$×+¨HÓ5“Dð6üò8s¹7GÃG
Ã,A%G+Ç
G(Ç'G(cóÊi}|j«D]M\}}t|t«r |D]}||vrtd|d«|||<ŒŒ6||vrtd|d«|||<ŒO|S)NzThe key z appears multiple times.)rr-r;)Úper_subplot_kwÚexpandedrrÚsub_keys r&Ú_norm_per_subplot_kwzFigureBase._norm_per_subplot_kwXsàˆØ"× ‰DˆAˆ˜!œUÔ ò* (¨8°G°;Ð>VÐ)WÓXØ()H˜
˜$ x°¨uÐ4LÐ%MÓ˜ ð ðˆr(cód|vr(|jd«Dcgc]
}t|«Œc}Stj|«}|j d«jd«Dcgc]
}t|«Œc}Scc}wcc}w)
ú;)ÚsplitÚlistÚinspectÚcleandocÚstrip)ÚlayoutÚlns r&Ú_normalize_grid_stringz!FigureBase._normalize_grid_stringgsnà  à'-§|¡|°CÓ'8Ö9 ”D˜•HÒ ×% -ˆFØ'-§|¡|°DÓ'9×'?Ñ'?ÀÓ'EÖF ”D˜•HÒ Fùò :ùòGs ˜A9Á$A>ú.)r6r7r9r:Úempty_sentinelr;r<có’xsiŠt| xsi«} ‰xsiŠ|d| vr td«|| d<|d| vr td«|| d<t|t«r>‰j |«}j «D
cic]\}
} t
|
«| Œc} }
Šj«Štjt||¬«dŠˆˆfdŠˆˆˆˆˆfdŠ|«}|j\} }
j| |
fi| ¤Ž}||g|«¢­Ž}tt|j«««}|j«D]M}|r#|j!|«|j#d ¬
«|sŒ+|j%|«|j'd ¬
«ŒOt)«t)|«z
x}rtd |d «|Scc} }
w)

Build a layout of Axes based on ASCII art or nested lists.
This is a helper function to build complex GridSpec layouts visually.
See :ref:`mosaic`
for an example and full API documentation
Parameters
----------
mosaic : list of list of {hashable or nested} or str
A visual layout of how you want your Axes to be arranged
labeled as strings. For example ::
x = [['A panel', 'A panel', 'edge'],
['C panel', '.', 'edge']]
produces 4 Axes:
- 'A panel' which is 1 row high and spans the first two columns
- 'edge' which is 2 rows high and is on the right edge
- 'C panel' which in 1 row and 1 column wide in the bottom left
- a blank space 1 row and 1 column wide in the bottom center
Any of the entries in the layout can be a list of lists
of the same form to create nested layouts.
If input is a str, then it can either be a multi-line string of
the form ::
'''
AAE
C.E
'''
where each character is a column and each line is a row. Or it
can be a single-line string where rows are separated by ``;``::
'AB;CC'
The string notation allows only single character Axes labels and
does not support nesting but is very terse.
The Axes identifiers may be `str` or a non-iterable hashable
object (e.g. `tuple` s may not be used).
sharex, sharey : bool, default: False
If True, the x-axis (*sharex*) or y-axis (*sharey*) will be shared
among all subplots. In that case, tick label visibility and axis
units behave as for `subplots`. If False, each subplot's x- or
y-axis will be independent.
width_ratios : array-like of length *ncols*, optional
Defines the relative widths of the columns. Each column gets a
relative width of ``width_ratios[i] / sum(width_ratios)``.
If not given, all columns will have the same width. Equivalent
to ``gridspec_kw={'width_ratios': [...]}``. In the case of nested
layouts, this argument applies only to the outer layout.
height_ratios : array-like of length *nrows*, optional
Defines the relative heights of the rows. Each row gets a
relative height of ``height_ratios[i] / sum(height_ratios)``.
If not given, all rows will have the same height. Equivalent
to ``gridspec_kw={'height_ratios': [...]}``. In the case of nested
layouts, this argument applies only to the outer layout.
subplot_kw : dict, optional
Dictionary with keywords passed to the `.Figure.add_subplot` call
used to create each subplot. These values may be overridden by
values in *per_subplot_kw*.
per_subplot_kw : dict, optional
A dictionary mapping the Axes identifiers or tuples of identifiers
to a dictionary of keyword arguments to be passed to the
`.Figure.add_subplot` call used to create each subplot. The values
in these dictionaries have precedence over the values in
*subplot_kw*.
If *mosaic* is a string, and thus all keys are single characters,
it is possible to use a single string instead of a tuple as keys;
i.e. ``"AB"`` is equivalent to ``("A", "B")``.
.. versionadded:: 3.7
gridspec_kw : dict, optional
Dictionary with keywords passed to the `.GridSpec` constructor used
to create the grid the subplots are placed on. In the case of
nested layouts, this argument applies only to the outer layout.
For more complex layouts, users should use `.Figure.subfigures`
to create the nesting.
empty_sentinel : object, optional
Entry in the layout to mean "leave this space empty". Defaults
to ``'.'``. Note, if *layout* is a string, it is processed via
`inspect.cleandoc` to remove leading white space, which may
interfere with using white-space as the empty sentinel.
Returns
-------
dict[label, Axes]
A dictionary mapping the labels to the Axes objects. The order of
the Axes is left-to-right and top-to-bottom of their position in the
total layout.
r:r>r9r?)r6r7cóä|^}}t|t«r td«t|d¬«D]d\}}t|t«r td«t |«t |«k7sŒ9td|dt |«d|d|dt |«d «t j t |«t |«ft¬ «}t|«D]\}}t|«D] \}}||||f<ŒŒ!|S)
aJ
Convert input into 2D array
We need to have this internal function rather than
``np.asarray(..., dtype=object)`` so that a list of lists
of lists does not get converted to an array of dimension > 2.
Returns
-------
2D object array
z$List mosaic specification must be 2Drˆ)z@All of the rows must be the same length, however the first row (z
) has length z and row z (r)rr0r;Ú enumeraterrÚzerosr¾)ÚinpÚr0ÚrestrÈÚoutrrs r&Ú _make_arrayz.FigureBase.subplot_mosaic.<locals>._make_arrayúsðˆIˆBܘ"œcÔ Ð!GÓ! $¨aÔ
˜a¤Ô$Ð%KÓr“7œc !*Ø*,¨¨}¼SÀ»W¸F#Ø#$ #  u¨M¼#¸a»&¸ÀðDóðð 
ô—((œC H¤c¨"£gÐ.´=ˆ! #ò
"% a"DAqØ !C˜˜1˜
ˆJr(có
tj«}i}t|«D]R\}}t|«D]?\}}|k(rŒ tj|«s|«|||f<Œ/|j |«ŒAŒTt |«|fS)ar
Given a 2D object array, identify unique IDs and nested mosaics
Parameters
----------
mosaic : 2D object array
Returns
-------
unique_ids : tuple
The unique non-sub mosaic entries in this mosaic
nested : dict[tuple[int, int], 2D object array]
)r^Ú _OrderedSetrÚis_scalar_or_stringr?r-) ÚmosaicÚ
unique_idsÚnestedrÈÚrowrrr
rs €€r&Ú_identify_keys_and_nestedz<FigureBase.subplot_mosaic.<locals>._identify_keys_and_nestedsø€ô×,ˆJ؈FÜ# FÓ
*% c*DA˜ Ü"×6°qÔ9Ù)4°Q«˜  1˜à 

˜Ó$  ,r(c
ó¬t«}t«}|D]}tj||k(«}tj|d¬«\}} tj|d¬«dz\}
} t ||
«t | | «f} || |k7j
«rtd|d|d«|| df||| f<Œ|j«D]\\}
}}d|d f||
|f<Œt|«D}||\}}}|dk(rR|} ||vrtd
|d |«j|| fid t|«i¥j|i«¥¤Ž}|||<Œc|d k(rz|}|\}
}|j\}}||
|fj||«|g|«¢­Ž}t|«t|«z}|rtd
|d
|d|«|j!|«Œât#d«|S)a<
Recursively do the mosaic.
Parameters
----------
gs : GridSpec
mosaic : 2D object array
The input converted to a 2D array for this level.
unique_ids : tuple
The identified scalar labels at this level of nesting.
nested : dict[tuple[int, int]], 2D object array
The identified nested mosaics, if any.
Returns
-------
dict[label, Axes]
A flat dict of all of the Axes created.
r)rxrˆzWhile trying to layout
z
we found that the label z4 specifies a non-rectangular or non-contiguous area.rNrzThere are duplicate keys z in the layout
rz between the outer layout
z
and the nested layout
zThis should never happen)r@rÚargwhereÚminrCÚsliceÚanyr;ryr(r0ÚgetÚshapeÚ subgridspecrjrKÚ RuntimeError)rErrrÚoutputÚ
this_levelr¸ÚindxÚ start_rowÚ start_colÚend_rowÚend_colÚslcrÈrÚ
nested_mosaicrAÚargÚmethodr}ÚrowsÚcolsÚ
nested_outputÚoverlapÚ
_do_layoutrr#r;s €€€€€r&r.z-FigureBase.subplot_mosaic.<locals>._do_layout4sø€ô&“Vˆˆ
Iä—{{ 6¨T¡>Ó2Ü')§v¡v¨d¸Ô';Ñ$ ˜9Ü#%§6¡6¨$°QÔ#7¸!Ñ#;Ñ ˜ä˜Y¨Ó0´%¸ À7Ó2KÐLà˜3K '×2°6°*ð=3Ø37°(ð;BðBóCðCð
7;¸Ð5H
˜I 
Ið$*0¯©«ò
EÑ%A˜
Ø&*¨M¸8Ð%D
˜A˜q˜
Eô
˜&
CØ$.¨s¡OÑ!c˜˜˜v‘~Ü(Ð+DÀTÀFðK;Ø;A¸*FóGðGàט3™ñà#¤S¨£Yð$à$ð°rÓ$ñ$&F˜4˜'Ø$'DAqà!.×!4Ñ!4JD˜$Ù$.ؘ1˜a˜4™×,¨T°4Ó%ñ3°=Ó%
" &k¬C°
Ó,>Ñ>Ü7¸°yðA9Ø9?¸
ðC6Ø6C°_ðFóðð
—MM &Ð'AÓBðM&
CðNˆMr(T)Úskip_non_rectangular_axesz The keys z/ are in *per_subplot_kw* but not in the mosaic.)r@r;rr0rr-rÚcheck_isinstanceÚboolrrAr<ÚiterrHr6Ú_label_outer_xaxisr7Ú_label_outer_yaxisrj)r#rr6r7r9r:rr;r<rrr*r+rEÚretÚax0r}Úextrar.rr
s` ``` @@@r&Úsubplot_mosaiczFigureBase.subplot_mosaicqsÿþ€ð\ Ò% 2ˆ
ܘ,¨"Ó-ˆ Ø-¨2ˆà Ð   ð"IóJðJà+8ˆÑ Ð  Ñ ð"IóJðJà*6ˆK˜Ñ  fœcÔ ×Ó8ˆFà(6×(<Ñ(<Ó(>÷Ù $  1”a“˜!‘ óˆNð×2°>ÓBˆô
×Ñœd¨6¸ õ< -÷8] ð] ñ~˜Ø—\‘\‰
ˆˆ
ˆT×
Ñ
˜t 
9¨[Ñ
9ˆÙ˜˜HÑ&?ÀÓ&GÒHˆÜ”4˜Ÿ
Ó&ˆØ—*‘*“,ò FˆBÙØ— ‘ ˜#”Ø×ÐØ— ‘ ˜#”Ø×Ð
 Fô˜Ó'¬#¨c«(Ñ 2ˆ ؘE˜7ð#)ðð
ðˆ
ùógsÂGcó|||k7r|j|«t|_|j|j«yr,)r'r5rrr7s r&Ú_set_artist_propszFigureBase._set_artist_props¦s/Ø Š9Ø
L‰L˜Ô ÜÔØ ˜×,r()gš™™™™™É?ér™r‚r,©F)rˆrˆ)NNT)NNNNNN)rˆrˆTNNNN)ErOrPrQrRr2r€rwr!ÚpropertyrÌr'rÚ SubstitutionÚcopyràrrrr
r
ÚframeonrÚinterpdrr(r"rBr4rIrcrgrpr”r™rAr3rr!Ú staticmethodrörr8r:Ú
__classcell__©rls@r&rUrUvs ø„ñôòBð(>Eó+òZ
ó%òN$ñ$Ð'i×
¸Ô
ð<€Fò óòJòX€Z×Ñ ¨°=ÀXØ %¨'ô€Z‡__ ñ
€Z×Ñ ¨°>ÀhØ (¨Wô€Z‡__ ñ
€Z×Ñ ¨°>ÀfØ (¨Wô€Z‡__ ñ
  ñ{ KÓ0€Gó!ðF×Ññnðn/ð`×Ññ}ð}0ò~ ðH°5ÀبDÀØ ¨dôHòTGò "$óH!óH9ð,×Ññuóðuðn×Ñò/óð/ðb×Ñà<@òuóðuðnGKØ,0ó*óX<Dó|;Dóz-Dó^$ó:-ð^48Ø'+Ø48óCòJò<ò ðB>BÈØ48ô!(òF ðGÀôGðRñ óð ðñGóðGð05¸UØ$(¸Ø&)Ø"&°tÈôsöj -r(rUcóÎeZdZdZdddddœˆfd
Zed«Zed«Zejd«Zd „Z d
Z
d Z dd Z d
Z
ddZdZed«Zej"ZdZˆxZS)a¿
Logical figure that can be placed inside a figure.
See :ref:`figure-api-subfigure` for an index of methods on this class.
Typically instantiated using `.Figure.add_subfigure` or
`.SubFigure.add_subfigure`, or `.SubFigure.subfigures`. A subfigure has
the same methods as a figure except for those particularly tied to the size
or dpi of the figure, and is confined to a prescribed region of the figure.
For example the following puts two subfigures side-by-side::
fig = plt.figure()
sfigs = fig.subfigures(1, 2)
axsL = sfigs[0].subplots(1, 2)
axsR = sfigs[1].subplots(2, 1)
See :doc:`/gallery/subplots_axes_and_figures/subfigures`
)Ú facecolorÚ edgecolorrr@c ó4t|d i|¤Ž|d}|tjd}|tjd}||_||_|j |_|j|_|j|_|j|_ |j|_
|j|_ tj«|_|j«|j
j |_t#|j|j
j$«|_t)|j&«|_t+ddd||||d|j$¬« |_|j/|j,«|j,j1d«y)

Parameters
----------
parent : `.Figure` or `.SubFigure`
Figure or subfigure that contains the SubFigure. SubFigures
can be nested.
subplotspec : `.gridspec.SubplotSpec`
Defines the region in a parent gridspec where the subfigure will
be placed.
facecolor : default: ``"none"``
The figure patch face color; transparent by default.
edgecolor : default: :rc:`figure.edgecolor`
The figure patch edge color.
linewidth : float
The linewidth of the frame (i.e. the edge linewidth of the figure
patch).
frameon : bool, default: :rc:`figure.frameon`
If ``False``, suppress drawing the figure background patch.
Other Parameters
----------------
**kwargs : `.SubFigure` properties, optional
%(SubFigure:kwdoc)s
noneúfigure.edgecolorúfigure.frameon©rrrˆF) ÚxyrêrwrGrHrÚ in_layoutrrrS)rZr2Ú _subplotspecr¦r2rrMÚ transFigurerÚnullÚ
bbox_relativerÄÚfigbboxrrrrrxr:Úset_antialiased) r#ÚparentrÒrGrHrr@rkrls €r&r2zSubFigure.__init__ÁsWø€ôH ÑÑ"˜ Р؈IØ Ð ÜŸ Ð%7Ñ8ˆIØ ˆ?Ü—llÐ#3Ñ4ˆGà'ˆÔ؈Œ ØÔ🈌
ØÔØÔØ"×ÔØ!×ÔÜ!ŸY™Y›[ˆÔØ ×—||×+ˆŒ Ü# D×$6Ñ$6Ø$(§L¡L×$?Ñ$?óAˆŒ ä-¨d¯i©iÓÔäØ˜Q q°'ب9À à t×':Ñ':ô <ˆŒ
ð
×јtŸz™zÔ
×" )r(có.|jjSr,)rOr1s r&rOzSubFigure.canvas sà|‰|×"r(có.|jjSr,©Údpir1s r&rZz
SubFigure.dpi
sà|‰|×ÑÐr(có&||j_yr,rY)r#Úvalues r&rZz
SubFigure.dpi sà ˆ Õr(có.|jjS)zY
Return the resolution of the parent figure in dots-per-inch as a float.
rYr1s r&Úget_dpizSubFigure.get_dpi sð|‰|×ÑÐr(có4||j_d|_y)z
Set the resolution of parent figure in dots-per-inch.
Parameters
----------
val : float
TN)rZr"©r#r$s r&Úset_dpizSubFigure.set_dpi sðˆ ÔØˆ
r(có6|jj«Sr,)rr1s r&rzSubFigure._get_renderer# sØ|‰|×+r(có||7|j|j_|j|j_y|jj «}t j |j««}t j |j««}||jjj«|j«z }||jjj«|j«z }|d|jjjj«|j«z }d|d|jjjj«|j«z z
}||f|j_||z||zf|j_y)a
Make the transSubfigure bbox relative to Figure transform.
Parameters
----------
bbox : bbox or None
If not None, then the bbox is used for relative bounding box.
Otherwise, it is calculated from the subplotspec.
Nrˆ)Úp0rSÚp1rPÚ get_gridspecrÚasarrayÚget_width_ratiosÚget_height_ratiosr¯Úsumr¢) r#rEÚwrÚhrÚdxÚdyr¹s r&z!SubFigure._redo_transform_rel_fig& s_ð Ð Ø$(§G¡GˆD× Ñ Ô !Ø$(§G¡GˆD× Ñ Ô à
×
Ñ
×
-ˆÜ
Z‰Z˜×
.ˆÜ
Z‰Z˜×
/ˆØ
×!×
*×
0°2·6±6³8Ñ
;ˆØ
×!×
*×
0°2·6±6³8Ñ
;ˆØ
Ð0×"×*×
1×
7¸"¿&¹&»(Ñ
BˆØ
Ð3T×&×.×4×:¸R¿V¹V»XÑ
Ø!# R ˆ×ÑÔØ!# ¨"¨r©'Ð 2ˆ×ÑÕr(có6|jj«S©zo
Return whether constrained layout is being used.
See :ref:`constrainedlayout_guide`.
)Úget_constrained_layoutr1s r&rqz SubFigure.get_constrained_layout? sð |‰|×4r(có:|jj|¬«S)ab
Get padding for ``constrained_layout``.
Returns a list of ``w_pad, h_pad`` in inches and
``wspace`` and ``hspace`` as fractions of the subplot.
See :ref:`constrainedlayout_guide`.
Parameters
----------
relative : bool
If `True`, then convert from inches to figure relative.
)Úrelative)Úget_constrained_layout_pads)r#rss r&rtz%SubFigure.get_constrained_layout_padsG sð|‰|×ÐJr(có6|jj«Sr,)r—r1s r&r—zSubFigure.get_layout_engineW sØ|‰|×/r(có |jddS)a
List of Axes in the SubFigure. You can access and modify the Axes
in the SubFigure through this list.
Modifying this list has no effect. Instead, use `~.SubFigure.add_axes`,
`~.SubFigure.add_subplot` or `~.SubFigure.delaxes` to add or remove an
Axes.
Note: The `.SubFigure.axes` property and `~.SubFigure.get_axes` method
are equivalent.
N)rar1s r&rzSubFigure.axesZ sð™qÐ!r(cón|j«sy|j|«} |jd|j«¬«|jj |«t
j||||jd¬«j«|jd«d|_ y#d|_ wxYw)NÚ subfigure©ÚgidTrF) r€Ú
open_groupÚget_gidrxÚdrawÚmimageÚ_draw_list_compositing_imagesr!riÚ close_groupr"©r#r|rbs r&r}zSubFigure.drawk s™ð×ÑÔ à×Óð Ø × Ñ   °·±³Ð Ô J‰JO‰O˜HÔ × ˜$ ¨¯©¸d¨Ó)C×)UÑ)Uô
Wà × Ñ  Ô ˆDJø˜ˆDJús ¤A?B+Â+ B4r,r<)rOrPrQrRr2r=rOrZÚsetterr^rarrqrtr—rÚfgetÚget_axesr}rCrDs@r&­ø„ñð& ØØØö C*ðJñðñ óð ð ‡Zð ò ò3ò2Kò ñ ð y‰y€Hör(c
ó,eZdZdZej
«ZdZdZ d>dddddddddœˆfd Z ˆfdZ
d „Z d?d
Z d Z
d Zd@dZed«Zej$Zed«Zej*d«ZdZdZd@dZeeed¬«ZdZej8ddd
¬«d«ZdZej8ddd
¬«d«Zej8ddd
¬«d „«Z ej8dd!d
¬«dAd"„«Z!d#„Z"e#jH dBdd$œd%„«Z%dCd&„Z&d'„Z'd(„Z(d)„Z)d*„Z*d+„Z+d@d,„Z,d@d-„Z-dAˆfd.„ Z.e/e0d/„««Z1d0„Z2d1„Z3ˆfd2„Z4d3„Z5d4„Z6dd5œd6„Z7d7d8d
e8jre8jte8jvfd9„Z<dDd:„Z=d;dddd<œd=„Z>ˆxZ?S)EÚFigureaÛ
The top level container for all the plot elements.
See `matplotlib.figure` for an index of class methods.
Attributes
----------
patch
The `.Rectangle` instance representing the figure background patch.
suppressComposite
For multiple images, the figure will make composite images
depending on the renderer option_image_nocomposite function. If
*suppressComposite* is a boolean, this will override the renderer.
cóFdt|jj«zS)Nz
Figure(%gx%g))r-r1s r&Ú__str__zFigure.__str__ sؤ t§y¡y§~¡~Ó!6Ñ6r(cóÖdj|jj|jjd|jjdt |j «¬«S)Nz.<{clsname} size {h:g}x{w:g} with {naxes} Axes>rrˆ)ÚclsnameÚnaxes)ÚformatrlrOrrr1s r&Ú__repr__zFigure.__repr__  sRØ?×—N‘N×i‰in‰n˜ 4§9¡9§>¡>°!Ñ#4Üd—ii“.ðGó
ð
r(NrF)rGrHrr@rÚ tight_layoutÚconstrained_layoutrÿc
óPt
|di| ¤Ž||_d|_|
A|t j
d«| t j
d«|j
|
¬«nÈ|Z| t j
d«|j
d¬«t|t«r|j«jdi|¤Žnl| Xt| t«r3|j
d¬«|j«jdi| ¤Žn'| r%|j
d¬«n|j
|
¬«tjtj¬«|_|jj } | d t"j$«| d
t"j$«| d
t"j$«| d t"j&«| d t"j&«| d
t"j&«| dt"j&«g|_| d |j*«|_| d
|j*«|_|t0j2d}|t0j2d}|t0j2d}|t0j2d}|t0j2d}t5j6|«j9«r&t5j:|«dkj=«rt?d|«tAjBddg|¢­Ž|_"tG«jI|«|_%||_&tO|jD|jJ«|_(|jP|_)tU|jP«|_+|jV|_,t[ddd||||d¬«|_.|j_|j\«|j\jad«t|«|
tc«}||_2tg«|_4|jk«y)
Parameters
----------
figsize : 2-tuple of floats, default: :rc:`figure.figsize`
Figure dimension ``(width, height)`` in inches.
dpi : float, default: :rc:`figure.dpi`
Dots per inch.
facecolor : default: :rc:`figure.facecolor`
The figure patch facecolor.
edgecolor : default: :rc:`figure.edgecolor`
The figure patch edge color.
linewidth : float
The linewidth of the frame (i.e. the edge linewidth of the figure
patch).
frameon : bool, default: :rc:`figure.frameon`
If ``False``, suppress drawing the figure background patch.
subplotpars : `~matplotlib.gridspec.SubplotParams`
Subplot parameters. If not given, the default subplot
parameters :rc:`figure.subplot.*` are used.
tight_layout : bool or dict, default: :rc:`figure.autolayout`
Whether to use the tight layout mechanism. See `.set_tight_layout`.
.. admonition:: Discouraged
The use of this parameter is discouraged. Please use
``layout='tight'`` instead for the common case of
``tight_layout=True`` and use `.set_tight_layout` otherwise.
constrained_layout : bool, default: :rc:`figure.constrained_layout.use`
This is equal to ``layout='constrained'``.
.. admonition:: Discouraged
The use of this parameter is discouraged. Please use
``layout='constrained'`` instead.
layout : {'constrained', 'compressed', 'tight', 'none', `.LayoutEngine`, None}, default: None
The layout mechanism for positioning of plot elements to avoid
overlapping Axes decorations (labels, ticks, etc). Note that
layout managers can have significant performance penalties.
- 'constrained': The constrained layout solver adjusts Axes sizes
to avoid overlapping Axes decorations. Can handle complex plot
layouts and colorbars, and is thus recommended.
See :ref:`constrainedlayout_guide` for examples.
- 'compressed': uses the same algorithm as 'constrained', but
removes extra space between fixed-aspect-ratio Axes. Best for
simple grids of Axes.
- 'tight': Use the tight layout mechanism. This is a relatively
simple algorithm that adjusts the subplot parameters so that
decorations do not overlap.
See :ref:`tight_layout_guide` for examples.
- 'none': Do not use a layout engine.
- A `.LayoutEngine` instance. Builtin layout classes are
`.ConstrainedLayoutEngine` and `.TightLayoutEngine`, more easily
accessible by 'constrained' and 'tight'. Passing an instance
allows third parties to provide their own layout engine.
If not given, fall back to using the parameters *tight_layout* and
*constrained_layout*, including their config defaults
:rc:`figure.autolayout` and :rc:`figure.constrained_layout.use`.
Other Parameters
----------------
**kwargs : `.Figure` properties, optional
%(Figure:kwdoc)s
NzdThe Figure parameters 'layout' and 'tight_layout' cannot be used together. Please use 'layout' only.zjThe Figure parameters 'layout' and 'constrained_layout' cannot be used together. Please use 'layout' only.)rÿztThe Figure parameters 'tight_layout' and 'constrained_layout' cannot be used together. Please use 'layout' parameterÚtightÚ constrained)ÚsignalsÚkey_press_eventÚkey_release_eventÚbutton_press_eventÚbutton_release_eventÚ scroll_eventÚmotion_notify_eventúfigure.figsizez
figure.dpizfigure.facecolorrKrLrú(figure size must be positive finite not rMrˆF)rNrwrGrHrrOrS)6rZr2Ú_layout_enginerr‡Úset_layout_enginerr@r—rjr^rdr
ÚeventsÚ_canvas_callbacksÚ_connect_picklablerÚ _key_handlerÚ_mouse_handlerÚ_mouse_key_idsÚpickÚ_button_pick_idÚ_scroll_pick_idrÅrr rÚarrayrr;rÚ from_boundsrèrÚscaleríÚ_dpirrTrrQrrrxr:rUrrr*r2rc)r#ÚfigsizerZrGrHrr@rrrrÿrkÚconnectrls €r&r2zFigure.__init__§ ø€ô@ ÑÑ"˜ ˆÔØÔà Ð ØÐ×BôCð×IôJð
× "¨&Ð
Ð
×
× "¨'Ð ˜Ô,×(×<¨|Ó
Ð
Ð,¬dÔ×&¨mÐ,×(×BÐ/AÓ×&¨mÐ
× "¨&Ð
"'×!7Ñ!7Ü$×"-ˆÔà×(×;ˆá Ð%¤}×'AÑ'AÓ Ð×)CÑ)CÓ Ð×)CÑ)CÓ Ð(¬-×*FÑ*FÓ Ð*¬M×,HÑ,HÓ N¤M×$@Ñ$@Ó Ð)¬=×+GÑ+GÓ 
ˆÔñ 'Ð';¸T¿Y¹YÓGˆÔÙ& ~°t·y±yÓAˆÔà ˆ?Ü—l‘lÐ#3Ñ4ˆGØ ˆ;Ü—,‘,˜|Ñ,ˆCØ Ð ÜŸ Ð%7Ñ8ˆIØ Ð ÜŸ Ð%7Ñ8ˆIØ ˆ?Ü—l‘lÐ#3Ñ4ˆ{‰{˜#×)¬b¯h©h°wÓ.?À!Ñ.C×-HÑ-HÔ-JÜÐGØ '˜
×+¨A¨qÐ;°7Ò;ˆÔä'›z×Ó4ˆÔàˆŒ Ü# D×$4Ñ$4°d×6JÑ6JÓKˆŒ Ø—y‘yˆŒ Ü*¨4¯9©9ÓÔØ.ˆÔäØ˜Q q°'ب9À àô ˆŒ
ð
×јtŸz™zÔ
×" ˜Ôà Ð Ü'/ˆ&ˆÔä" ˆŒ
Ø
r(cón|jjj«st||«yyr,)rOÚ
widgetlockÚlockedrZ)r#rls €r&z Figure.picke
s*ø€Ø{‰{× ‰G‰L˜Õ /r(có€||y|j|jk(ry|jD]}t|d«sŒyy)
Helper for set_layout engine
If the figure has used the old engine and added a colorbar then the
value of colorbar_gridspec must be the same on the new engine.
TÚ _colorbarF)rrr{)r#ÚoldÚnewr}s r&Ú_check_layout_engines_compatz#Figure._check_layout_engines_compati
sNð ˆ;˜#˜+ØØ × Ñ  C×$9Ñ$9Ò ð—) ˆBÜr˜ð ðr(c ó
|€4tjdrd}ntjdrd}nd|_y|dk(r td i|¤Ž}nŽ|dk(r t d i|¤Ž}n}|dk(rt d ddi|¤Ž}nj|d k(rD|j5t |jj |jj«}n$d}n!t|t«r|}ntd
|«|j|j|«r||_ytd «)

Set the layout engine for this figure.
Parameters
----------
layout : {'constrained', 'compressed', 'tight', 'none', `.LayoutEngine`, None}
- 'constrained' will use `~.ConstrainedLayoutEngine`
- 'compressed' will also use `~.ConstrainedLayoutEngine`, but with
a correction that attempts to make a good layout for fixed-aspect
ratio Axes.
- 'tight' uses `~.TightLayoutEngine`
- 'none' removes layout engine.
If a `.LayoutEngine` instance, that instance will be used.
If `None`, the behavior is controlled by :rc:`figure.autolayout`
(which if `True` behaves as if 'tight' was passed) and
:rc:`figure.constrained_layout.use` (which if `True` behaves as if
'constrained' was passed). If both are `True`,
:rc:`figure.autolayout` takes priority.
Users and libraries can define their own layout engines and pass
the instance directly as well.
**kwargs
The keyword arguments are passed to the layout engine to set things
like padding and margin sizes. Only used if *layout* is a string.
figure.autolayoutr“úfigure.constrained_layout.user”Ú
compressedÚcompressTrJzInvalid value for 'layout': zzColorbar layout of new layout engine not compatible with old engine, and a colorbar has been created. Engine not changed.rS)
rrrr˜rrrr;r)r#rÿrkÚnew_layout_engines r&zFigure.set_layout_engine|
s(ð> ˆ|‰|Ð ÜÐ&à&*ÔØ  Ü 1Ñ ;°FÑ ;Ñ Ø

$Ü 7Ñ A¸&Ñ AÑ Ø

#Ü 7ñ!BÀð!BØ:@ñ!BÑ à

Ø×.Ü$;Ø×'××'×%Ñ
%)Ñ
˜¤ Ô
-Ø &Ñ äÐ;¸F¸ × ,¨T×-@Ñ-@Ø->ô @à"3ˆ äð HóIð
Ir(có|jSr,)r1s r&r—zFigure.get_layout_engine¿
sØ×"r(cótdt|j«jvrddlm}|j |«Sy)WebAggr)Úbackend_webagg)ÚtyperOrOÚmatplotlib.backendsrÀÚipython_inline_display)r#s r&Ú _repr_html_zFigure._repr_html_Æ
s4ð ”t˜DŸK™KÓ !×8¸Ó  2r(Tcó|jj td« |jjj«y#t$r/}|r#t j t|««Yd}~yYd}~yd}~wwxYw)
If using a GUI backend with pyplot, display the figure window.
If the figure was not created using `~.pyplot.figure`, it will lack
a `~.backend_bases.FigureManagerBase`, and this method will raise an
AttributeError.
.. warning::
This does not manage an GUI event loop. Consequently, the figure
may only be shown briefly or not shown at all if you or your
environment are not managing an event loop.
Use cases for `.Figure.show` include running this from a GUI
application (where there is persistently an event loop running) or
from a shell, like IPython, that install an input hook to allow the
interactive shell to accept input while the figure is also being
shown and interactive. Some, but not all, GUI toolkits will
register an input hook on import. See :ref:`cp_integration` for
more details.
If you're in a shell without input hook integration or executing a
python script, you should use `matplotlib.pyplot.show` with
``block=True`` instead, which takes care of starting and running
the event loop for you.
Parameters
----------
warn : bool, default: True
If ``True`` and we are not running headless (i.e. on Linux with an
unset DISPLAY), issue warning when called on a non-GUI backend.
NzYFigure.show works only for figures managed by pyplot, normally created by pyplot.figure())rOÚmanagerÚAttributeErrorÚshowrrr‡r0)r#ÚwarnÚexcs r&z Figure.showÍ
soðD ;‰;× Ñ Ð  ð
 K‰K× Ñ × &øÜòÜ×"¤3 s£8×ûð -ús£$AÁ BÁ A;Á;Bcó6|jj«S)as
List of Axes in the Figure. You can access and modify the Axes in the
Figure through this list.
Do not modify the list itself. Instead, use `~Figure.add_axes`,
`~.Figure.add_subplot` or `~.Figure.delaxes` to add or remove an Axes.
Note: The `.Figure.axes` property and `~.Figure.get_axes` method are
equivalent.
)r2r4r1s r&rz Figure.axesù
sð}‰}×&r(cóHt|d«r |jStd«)z5The figure id, used to identify figures in `.pyplot`.Ú_numberze'Figure' object has no attribute 'number'. In the future thiswill change to returning 'None' instead.)r{r1s r&Únumberz
Figure.number s*ô 4˜Ô —< ä ð
<r(có@tjdd¬«||_y)Nr¢zcChanging 'Figure.number' is deprecated since %(since)s and will raise an error starting %(removal)sr£)r)r#Únums r&z
Figure.number s"ä ×ÑØ ð @ðˆ r(cóxt|jd«r|jj«St|«S) get_renderer)r{rOrr1s r&rzFigure._get_renderer' s.Ü 4—;Ô —;‘;×   Ó &r(có|jSr,)r1s r&Ú_get_dpizFigure._get_dpi- s Øy‰yÐr(cóÒ||jk(ry||_|jj«j|«|j «\}}|j |||¬«y)z
Parameters
----------
dpi : float
forward : bool
Passed on to `~.Figure.set_size_inches`
Úforward)rcÚget_size_inchesÚset_size_inches)r#rZr×rs r&Ú_set_dpizFigure._set_dpi0 s^ð $—)‘)Ò à ØˆŒ Ø ×Ñ×$×*¨3Ô×%‰ˆˆ1Ø ×јQ ¨7ÐÕ3r(z The resolution in dots per inch.r«có>t|j«t«S)z=Return whether `.Figure.tight_layout` is called when drawing.)rr—rr1s r&Úget_tight_layoutzFigure.get_tight_layoutC sä˜$×2Ô4EÓFr(z3.6rŸ)Ú alternativeÚpendingcó¨|tjd}t|«rdnd}t|t«r|ni}|j
|fi|¤Žd|_y)
Set whether and how `.Figure.tight_layout` is called when drawing.
Parameters
----------
tight : bool or dict with keys "pad", "w_pad", "h_pad", "rect" or None
If a bool, sets whether to call `.Figure.tight_layout` upon drawing.
If ``None``, use :rc:`figure.autolayout` instead.
If a dict, pass it as kwargs to `.Figure.tight_layout`, overriding the
default paddings.
Nr¸r“rJr1rr@r")r#r“Ú_tightÚ_tight_parameterss r&Úset_tight_layoutzFigure.set_tight_layoutG sSð ˆ—L‘LÐ!4Ñ5ˆEÜ  œK¨VˆÜ%/°´tÔ%<™EÀ"ÐØˆ×јvÑ;Ð):Òˆ
r(có>t|j«t«Srp)rr—rr1s r&rqzFigure.get_constrained_layout\ sô ˜$×2Ô4KÓLr(z set_layout_engine('constrained')có¨|tjd}t|«rdnd}t|t«r|ni}|j
|fi|¤Žd|_y)
Set whether ``constrained_layout`` is used upon drawing.
If None, :rc:`figure.constrained_layout.use` value will be used.
When providing a dict containing the keys ``w_pad``, ``h_pad``
the default ``constrained_layout`` paddings will be
overridden. These pads are in inches and default to 3.0/72.0.
``w_pad`` is the width padding and ``h_pad`` is the height padding.
Parameters
----------
constrained : bool or dict or None
Nr¹r”rJTrà)r#r”Ú _constrainedÚ _parameterss r&Úset_constrained_layoutzFigure.set_constrained_layoutd sSð" Ð ÜŸ,™,Ð'FÑGˆKÜ(,¨[Ô(9}¸vˆ Ü%/° ¼TÔ%B‘kȈ ؈×ј|Ñ;¨{Òˆ
r(z figure.get_layout_engine().set()c ó‚t|j«t«r!|j«jdi|¤Žyy)aS
Set padding for ``constrained_layout``.
Tip: The parameters can be passed from a dictionary by using
``fig.set_constrained_layout(**pad_dict)``.
See :ref:`constrainedlayout_guide`.
Parameters
----------
w_pad : float, default: :rc:`figure.constrained_layout.w_pad`
Width padding in inches. This is the pad around Axes
and is meant to make sure there is enough room for fonts to
look good. Defaults to 3 pts = 0.04167 inches
h_pad : float, default: :rc:`figure.constrained_layout.h_pad`
Height padding in inches. Defaults to 3 pts.
wspace : float, default: :rc:`figure.constrained_layout.wspace`
Width padding between subplots, expressed as a fraction of the
subplot width. The total padding ends up being w_pad + wspace.
hspace : float, default: :rc:`figure.constrained_layout.hspace`
Height padding between subplots, expressed as a fraction of the
subplot width. The total padding ends up being h_pad + hspace.
NrS)rr—rrj)r#rks r&Úset_constrained_layout_padsz"Figure.set_constrained_layout_pads| s:ô> d×.Ô0GÔ (ˆD× $× 2¨6Ó  Ir(zfig.get_layout_engine().get()có<t|j«t«sy|j«j«}|d}|d}|d}|d}|rD||@|j «}|j
}||z|j z }||z|jz }||||fS)
Get padding for ``constrained_layout``.
Returns a list of ``w_pad, h_pad`` in inches and
``wspace`` and ``hspace`` as fractions of the subplot.
All values are None if ``constrained_layout`` is not used.
See :ref:`constrainedlayout_guide`.
Parameters
----------
relative : bool
If `True`, then convert from inches to figure relative.
)NNNNÚw_padÚh_padršr)rr—rrrrZ) r#rsrr|rZs r&rtz"Figure.get_constrained_layout_padsž s­ô"˜$×2Ô4KÔ×'×-ˆØW
ˆØW
ˆØh‘ˆØh‘ˆá ˜Ð*¨eÐ.?Ø×+ˆHØ—,‘,ˆCؘC‘K (§.¡.Ñ0ˆEؘCK (§/¡/Ñ1ˆe˜V +r(có||_y)z~
Set the canvas that contains the figure
Parameters
----------
canvas : FigureCanvas
N)rO)r#rOs r&Ú
set_canvaszFigure.set_canvas¿ s ðˆ r()Ú colorizerc 
ó|
rQ|j«}
|jd|jdfDcgc]}||
z Œ }}|j|d¬«tj|f||| ||| dœ| ¤Ž}t
|_|j|«|j|«|€&|j| ||¬«|j||«|jj|«|jj|_d|_|Scc}w)ai
Add a non-resampled image to the figure.
The image is attached to the lower or upper left corner depending on
*origin*.
Parameters
----------
X
The image data. This is an array of one of the following shapes:
- (M, N): an image with scalar data. Color-mapping is controlled
by *cmap*, *norm*, *vmin*, and *vmax*.
- (M, N, 3): an image with RGB values (0-1 float or 0-255 int).
- (M, N, 4): an image with RGBA values (0-1 float or 0-255 int),
i.e. including transparency.
xo, yo : int
The *x*/*y* image offset in pixels.
alpha : None or float
The alpha blending value.
%(cmap_doc)s
This parameter is ignored if *X* is RGB(A).
%(norm_doc)s
This parameter is ignored if *X* is RGB(A).
%(vmin_vmax_doc)s
This parameter is ignored if *X* is RGB(A).
origin : {'upper', 'lower'}, default: :rc:`image.origin`
Indicates where the [0, 0] index of the array is in the upper left
or lower left corner of the Axes.
resize : bool
If *True*, resize the figure to match the given image size.
%(colorizer_doc)s
This parameter is ignored if *X* is RGB(A).
Returns
-------
`matplotlib.image.FigureImage`
Other Parameters
----------------
**kwargs
Additional kwargs are `.Artist` kwargs passed on to `.FigureImage`.
Notes
-----
figimage complements the Axes image (`~matplotlib.axes.Axes.imshow`)
which will be resampled to fit the current Axes. If you want
a resampled image to fill the entire figure, you can define an
`~matplotlib.axes.Axes` with extent [0, 0, 1, 1].
Examples
--------
::
f = plt.figure()
nx = int(f.get_figwidth() * f.dpi)
ny = int(f.get_figheight() * f.dpi)
data = np.random.random((ny, nx))
f.figimage(data)
plt.show()
rˆrTrÖ)ÚcmapÚnormrðÚoffsetxÚoffsetyÚorigin)ÚvminÚvmax)r^rr~Ú FigureImager'r5Ú set_arrayÚ set_alphaÚ_check_exclusionary_keywordsÚset_climrfrr9r")r#ÚxoÚyoÚalpharóÚresizerðrkrZrWr­s r&ÚfigimagezFigure.figimageÉ sñZ Ø—,‘,“.ˆCØ)*¯©°©°Q·W±W¸Q±ZÐ(@ÖA 1q˜3“wÐAˆGÐ × Ñ  °$Ð Ô
×
Ñ
 ð9¨4°dØ*3Ø(*°BØ'-ñ28ñ9ˆôÔà
Ø
Ø ˆ<Ø × +¨I¸DÀtÐ K‰K˜˜dÔ  ×ј2ÔØ ŸK™K×ÔØˆŒ
؈ ùò#Bs³ DcóŠ||\}}tj||g«}tj|«j«r|dkj «rt d|«||j _|rG|jj}|/|j||jzjt«Žd|_y)aH
Set the figure size in inches.
Call signatures::
fig.set_size_inches(w, h) # OR
fig.set_size_inches((w, h))
Parameters
----------
w : (float, float) or float
Width and height in inches (if height not specified as a separate
argument) or width.
h : float
Height in inches.
forward : bool, default: True
If ``True``, the canvas size is automatically updated, e.g.,
you can resize the figure window from the shell.
See Also
--------
matplotlib.figure.Figure.get_size_inches
matplotlib.figure.Figure.set_figwidth
matplotlib.figure.Figure.set_figheight
Notes
-----
To transform from pixels to inches divide by `Figure.dpi`.
NrrT)rr rrr;rerOrrZÚastyper/r")r#rr×s r&zFigure.set_size_inches+ ð<
ˆ9؉DˆAˆqÜx‰x˜˜A˜ÓˆÜ{‰{˜4Ó ×&¨4°!©8¯.©.Ô*:ÜÐÀvÐ ×ÑÔÙ Ø—k‘k×)ˆGØÐ ¨¯©¡× 8Ñ 8¼Ó =ш
r(cóTtj|jj«S)
Return the current size of the figure in inches.
Returns
-------
ndarray
The size (width, height) of the figure in inches.
See Also
--------
matplotlib.figure.Figure.set_size_inches
matplotlib.figure.Figure.get_figwidth
matplotlib.figure.Figure.get_figheight
Notes
-----
The size in pixels can be obtained by multiplying with `Figure.dpi`.
)rrer1s r&zFigure.get_size_inchesU sô&x‰x˜×(×,r(có.|jjS)z"Return the figure width in inches.)r1s r&Ú get_figwidthzFigure.get_figwidthj sà×Ñ×%r(có.|jjS)z#Return the figure height in inches.)r1s r&Ú
get_figheightzFigure.get_figheightn sà×Ñ×&r(có|jS)z2Return the resolution in dots per inch as a float.)rZr1s r&r^zFigure.get_dpir s àx‰xˆr(có ||_d|_y)z
Set the resolution of the figure in dots-per-inch.
Parameters
----------
val : float
TN)rZr"r`s r&razFigure.set_dpiv sðˆŒØˆ
r(cóH|j||j«|¬«y)a0
Set the width of the figure in inches.
Parameters
----------
val : float
forward : bool
See `set_size_inches`.
See Also
--------
matplotlib.figure.Figure.set_figheight
matplotlib.figure.Figure.set_size_inches
N)r
©r#r$r×s r&Ú set_figwidthzFigure.set_figwidth s"ð
×јS $×"4Ñ"4Ó"6ÀÐÕHr(cóH|j|j«||¬«y)a0
Set the height of the figure in inches.
Parameters
----------
val : float
forward : bool
See `set_size_inches`.
See Also
--------
matplotlib.figure.Figure.set_figwidth
matplotlib.figure.Figure.set_size_inches
N)rrs r&Ú
set_figheightzFigure.set_figheight s"ð
×јT×0°#¸wÐÕGr(cóxt||¬«|jj}||j «yy)Nra)rZrcrOÚtoolbarrK)r#rbrrls €r&rcz Figure.clear£ s7ø€ä

 ^ˆ
Ô—+‘+ר Ð Ø N‰NÕ ð r(cóp|j«sy|j5|j|«} |jd|j «¬«|j
r0|j
« |j
«j|«|jj|«tj||||j«|jd«d|_t!d|j"|«j%«ddd«y#t$rYŒŽwxYw#d|_wxYw#1swYyxYw)Nr'ry
draw_event)Ú _render_lockr€r{r|rr—Úexecuter;rxr}r~rrir€r"r rOÚ_processrs r&r}z Figure.draw¬ sð×ÑÔ à
×
Ñ
ñ Fà×,¨XÓ6ˆGð