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

374 lines
36 KiB
Plaintext
Raw Normal View History

Ë
†RjZtãóàdZddlZddlZddlmZddlZddlZddlm Z m
Z
m Z ddl m
Z
eje«ZGdd«ZGdd e«ZGd
d e«ZGd d
«ZGdd«Zy)
:mod:`~matplotlib.gridspec` contains classes that help to layout multiple
`~.axes.Axes` in a grid-like pattern within a figure.
The `GridSpec` specifies the overall grid structure. Individual cells within
the grid are referenced by `SubplotSpec`\s.
Often, users need not access this module directly, and can use higher-level
methods like `~.pyplot.subplots`, `~.pyplot.subplot_mosaic` and
`~.Figure.subfigures`. See the tutorial :ref:`arranging_axes` for a guide.
éN)ÚIntegral)Ú_apiÚ_pylab_helpersÚ
_tight_layout)ÚBboxcó¦eZdZdZddZdZedd¬«Zedd ¬«Zd
Z dd Z
dd Z d
Z dZ
dZdZdZed«ZdZdddddœdZy)Ú GridSpecBasezm
A base class of GridSpec that specifies the geometry of the grid
that a subplot will be placed.
Ncóòt|t«r|dkrtd|«t|t«r|dkrtd|«||c|_|_|j |«|j
|«y)
Parameters
----------
nrows, ncols : int
The number of rows and columns of the grid.
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.
rz/Number of rows must be a positive integer, not z2Number of columns must be a positive integer, not N)Ú
isinstancerÚ
ValueErrorÚ_nrowsÚ_ncolsÚset_height_ratiosÚset_width_ratios)ÚselfÚnrowsÚncolsÚ
height_ratiosÚ width_ratioss úV/home/antigravity/intellecton/venv/lib/python3.12/site-packages/matplotlib/gridspec.pyÚ__init__zGridSpecBase.__init__ sô˜%¤Ô*¨e°qªjÜØAÀ%ÀÐMð
Mä˜%¤Ô*¨e°qªjÜØDÀUÀIÐPð
Pà#(¨%Ð ˆŒ T”[Ø ×ј}Ô ×јlÕcóJtt|j««dk7rd|jnd}tt|j««dk7rd|jnd}dj |j
j |j|j||z¬«S)z, height_ratios=Úz, width_ratios=z&{clsname}({nrows}, {ncols}{optionals}))ÚclsnamerrÚ optionals) ÚlenÚsetÚ_row_height_ratiosÚ_col_width_ratiosÚformatÚ __class__Ú__name__r
r)rÚ
height_argÚ width_args rÚ__repr__zGridSpecBase.__repr__9äœS ×!8Ñ!8Ó:¸×)@Ñ)@Ð(CÑDØEGð ôœC × 6Ñ 6Ó8¸' t×'=Ñ'=Ð&@ÑAØCEð à7×—NN×—+‘+Ø—+‘+Ø  9Ñð rcó|jS©N)r
©rs rú<lambda>zGridSpecBase.<lambda>Eó
 $§+¡+€rzThe number of rows in the grid.)Údoccó|jSr))rr*s rr+zGridSpecBase.<lambda>Gr,rz"The number of columns in the grid.có2|j|jfS)zW
Return a tuple containing the number of rows and columns in the grid.
)r
rr*s rÚ get_geometryzGridSpecBase.get_geometryJsð{‰{˜DŸK™KÐ'rcóyr)©)rÚfigures rÚget_subplot_paramszGridSpecBase.get_subplot_paramsPsà rcó2|\}}||||z|||zf}|S)a[
Create and return a `.SubplotSpec` instance.
Parameters
----------
loc : (int, int)
The position of the subplot in the grid as
``(row_index, column_index)``.
rowspan, colspan : int, default: 1
The number of rows and columns the subplot should span in the grid.
r2)rÚlocÚrowspanÚcolspanÚloc1Úloc2Ú subplotspecs rÚnew_subplotspeczGridSpecBase.new_subplotspecTs4ð
ˆˆdؘ4  W¡ Ð,¨d°4¸±<Ð.?Ð@ˆ ØÐrcóŒ|dg|jz}||_yt|«|jk7r td«||_y)
Set the relative widths of the columns.
*width_ratios* must be of length *ncols*. Each column gets a relative
width of ``width_ratios[i] / sum(width_ratios)``.
NrzTExpected the given number of width ratios to match the number of columns of the grid)rrr r!)rrs rrzGridSpecBase.set_width_ratiosdsTð Рؘ3 §¡Ñ,ˆLð".ˆÕôÓ
 $§+¡+Ò
ðGóHð
Hà!-ˆÕrcó|jS)zo
Return the width ratios.
This is *None* if no width ratios have been set explicitly.
)r!r*s rÚget_width_ratioszGridSpecBase.get_width_ratiosrsð ×%rcóŒ|dg|jz}||_yt|«|jk7r td«||_y)
Set the relative heights of the rows.
*height_ratios* must be of length *nrows*. Each row gets a relative
height of ``height_ratios[i] / sum(height_ratios)``.
NrzRExpected the given number of height ratios to match the number of rows of the grid)r
rr r )rrs rrzGridSpecBase.set_height_ratioszsTð РؘC $§+¡+Ñ-ˆMð#0ˆÕôÓ
 4§;¡;Ò
ðDóEð
Eà"/ˆÕrcó|jS)zq
Return the height ratios.
This is *None* if no height ratios have been set explicitly.
)r r*s rÚget_height_ratioszGridSpecBase.get_height_ratiosˆsð ×&rcó¾|j«\}}|j|«}|j}|j}|j}|j
}|j } |j}
||z
} ||z
} | ||
|dz
zzz }
|
|
z}|
|zt|j«z }|jDcgc]}||zŒ }}dg|g|dz
zz}tjtj||g«j«}| || |dz
zzz }| |z}||zt|j«z }|jDcgc]}||zŒ }}dg|g|dz
zz}tjtj||g«j«}||z
jd«j \}}||zjd«j \}}||||fScc}wcc}w)
Return the positions of the grid cells in figure coordinates.
Parameters
----------
fig : `~matplotlib.figure.Figure`
The figure the grid should be applied to. The subplot parameters
(margins and spacing between subplots) are taken from *fig*.
Returns
-------
bottoms, tops, lefts, rights : array
The bottom, top, left, right positions of the grid cells in
figure coordinates.
rr)éÿÿÿÿé)r0r4ÚleftÚrightÚbottomÚtopÚwspaceÚhspaceÚsumr ÚnpÚcumsumÚ column_stackÚflatr!ÚreshapeÚT)rÚfigrrÚsubplot_paramsrFrGrHrIrJrKÚ tot_widthÚ
tot_heightÚcell_hÚsep_hÚnormÚ cell_heightsÚ sep_heightsÚcell_hsÚcell_wÚsep_wÚ cell_widthsÚ
sep_widthsÚcell_wsÚfig_topsÚ fig_bottomsÚ fig_leftsÚ
fig_rightss rÚget_grid_positionszGridSpecBase.get_grid_positionsð ×*‰ ˆˆuØ×Ó5ˆØ×"ˆØ×$ˆØ×&ˆØ× Ñ ˆØ×&ˆØ×&ˆØ˜DLˆ ؘ6
ð˜u v¨u°Q©wÑ'7ÑØ˜ˆØ˜‰~¤ D×$;Ñ$;Ó <Ñ<ˆØ*.×*AÑ*AÖB Q˜˜D›Ð Ðc˜e˜W¨¨a©Ñ Ü—)‘)œBŸO™O¨[¸,Ð,GÓNˆð˜e f¨e°A©gÑ&6ÑØ˜ˆØ˜‰~¤ D×$:Ñ$:Ó ;Ñ;ˆØ)-×)?Ñ)?Ö@ Aq˜4“xÐ@ˆ ÐS˜U˜G u¨Q¡wÑ0ˆ
Ü—)‘)œBŸO™O¨Z¸Ð,EÓà!$ w¡× 7Ñ 7¸Ó @× BÑ Bш+Ø!%¨¡× 8Ñ 8¸Ó A× CÑ Cш ˜H i°Ð;ùòCùòAs Â3 GÄ> Gcóô|j«D]X}|j«}|Œt|d«r|j«j«}|j «||fk(sŒV|cSt |||¬«S)zo
Check if the figure already has a gridspec with these dimensions,
or create a new one
Úget_topmost_subplotspec©r3)Úget_axesÚ get_gridspecÚhasattrrir0ÚGridSpec)r3rrÚaxÚgss rÚ_check_gridspec_existsz#GridSpecBase._check_gridspec_exists¿sxð —/‘/Ó ˆBØÓ"ˆB؉~ܘ2Ð ×D—?‘?Ó°¨Ó’Ið ô˜˜u¨VÔ4rcó*|j«\}}d}t|t«r4 |\}}t j
|||d«|||d«g||f«\}} n||||zd«\}} t
||| «S#t$r}td«|d}~wwxYw)z,Create and return a `.SubplotSpec` instance.có|}t|t«r,|j|«\}}}||kDr||dz
fStd«|dkr||z}d|cxkr|kr||fS|td|d|d|«td|d|«)Nrz=GridSpec slice would result in no space allocated for subplotrzindex z is out of bounds for axis z with size z) is out of bounds for GridSpec with size )r ÚsliceÚindicesÚ
IndexError)ÚkeyÚsizeÚaxisÚorig_keyÚstartÚstopÚ_s rÚ
_normalizez,GridSpecBase.__getitem__.<locals>._normalizeØØˆHܘ#œuÔ%Ø!$§¡¨TÓ!2t˜˜%’<Ø  ¡(˜ ð"9ó˜’7Ø ™*˜”?˜d’?Ø ˜8Ð$ v¨h¨Zð8-Ø-1¨F°+¸d¸&EóFðFô% v¨h¨Zð8;Ø;?¸&BóCðCrzUnrecognized subplot specNrr)r0r Útupler rMÚravel_multi_indexÚ SubplotSpec)
rrwrrr~Úk1Úk2ÚerrÚnum1Únum2s
rÚ __getitem__zGridSpecBase.__getitem__Ôà×*‰ ˆˆuò Cô( cœ5Ô 
GØ×˜B  qÓ)©:°b¸%ÀÓ+CИó ‰JˆD‘$ñ$ C¨°©¸Ó=‰JˆD˜4  tÓ,øôò
GÜ Ð!<Ó=À3ÐFûð
Gús¨A8Á8 BÂ B
Â
BFT)ÚsharexÚshareyÚsqueezeÚ
subplot_kwcó6|j}| td«t|t«s|rdnd}t|t«s|rdnd}t j
gd¢||¬«|i}|j
«}tj|j|jft¬«}t|j«D]]}t|j«D]C}d|d||d f|d |fd
œ} | ||d <| ||d <|j|||ffi|¤Ž|||f<ŒEŒ_|d
vr#|jD]}
|
jd¬«Œ|dvr#|jD]}
|
j!d¬«Œ|r/|j"dk(r|j%«S|j'«S|S)z
Add all subplots specified by this `GridSpec` to its parent figure.
See `.Figure.subplots` for detailed documentation.
NzIGridSpec.subplots() only works for GridSpecs created with a parent figureÚallÚnone)rÚrowÚcolrŽFT)rˆr‰)Údtype)rrr)rrrrˆr‰)rrT)Úskip_non_rectangular_axes)rrr)r3r r ÚstrrÚ
check_in_listÚcopyrMÚemptyr
rÚobjectÚrangeÚ add_subplotrPÚ_label_outer_xaxisÚ_label_outer_yaxisrxÚitemrŠ) rrˆr‰rr3ÚaxarrrrÚ shared_withros rÚsubplotszGridSpecBase.subplotsùðˆà ˆ>Üð
˜&¤#Ô$U¨&ˆ˜&¤#Ô$U¨&ˆ ×ÑÒEØ"(°õ Р؈—_&ˆ
ô˜$Ÿ+™+ t§{¡{Ð3¼6ÔܘŸÓ 2ˆCܘTŸ[™[Ó
2Ø'+°E¸$±KØ&+¨C°¨F¡m¸EÀ!ÀSÀ&¹MñK à'2°6Ñ':
˜$Ø'2°6Ñ':
˜$Ø"4 &×"4Ñ"4ؘ˜c˜#2Ø&0ñ#2c˜3hñ 
  —j‘jò
FØ×Ð
Fà  —j‘jò
FØ×Ð
Fñ ð$)§:¡:°¢?5—::“<Ð G¸¿
¹
»Ð ˆLr)NNr))rr)r$Ú
__module__Ú __qualname__Ú__doc__rr'Úpropertyrrr0r4r<rr?rrBrgÚ staticmethodrqr‡r2rrr r s‡ñó
,ò2
ñ
Ñ
<€Eá Ñ
?€Eò 
óò  -<ð^ñð5ò(#-ðJ"'¨u¸ õ3rr cóTeZdZdZ dˆfd„ Zgd¢ZdZd dZdZ d
dZ ˆxZ
S) rna
A grid layout to place subplots within a figure.
The location of the grid cells is determined in a similar way to
`.SubplotParams` using *left*, *right*, *top*, *bottom*, *wspace*
and *hspace*.
Indexing a GridSpec instance returns a `.SubplotSpec`.
c óŽ||_||_||_||_||_| |_||_t |!|||
| ¬«y)
Parameters
----------
nrows, ncols : int
The number of rows and columns of the grid.
figure : `.Figure`, optional
Only used for constrained layout to create a proper layoutgrid.
left, right, top, bottom : float, optional
Extent of the subplots as a fraction of figure width or height.
Left cannot be larger than right, and bottom cannot be larger than
top. If not given, the values will be inferred from a figure or
rcParams at draw time. See also `GridSpec.get_subplot_params`.
wspace : float, optional
The amount of width reserved for space between subplots,
expressed as a fraction of the average axis width.
If not given, the values will be inferred from a figure or
rcParams when necessary. See also `GridSpec.get_subplot_params`.
hspace : float, optional
The amount of height reserved for space between subplots,
expressed as a fraction of the average axis height.
If not given, the values will be inferred from a figure or
rcParams when necessary. See also `GridSpec.get_subplot_params`.
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.
©rrN) rFrHrGrIrJrKr3Úsuperr)
rrrr3rFrHrGrIrJrKrrr#s
€rrzGridSpec.__init__9sSø€ðTˆŒ ؈Œ ؈Œ
؈ŒØˆŒ ؈Œ ؈Œ ä
ј Ø&2Ø'4ð õ 6r©rFrHrGrIrJrKc ó0|j«D].\}}||jvrt|||«Œ"t|d«tj
j j«D}|jjjD]…}|j«Œ|j«j«}|j«|k(sŒF|jd¬«}|j|j«j!|««Œ‡Œ¬y)a 
Update the subplot parameters of the grid.
Parameters that are not explicitly given are not changed. Setting a
parameter to *None* resets it to :rc:`figure.subplot.*`.
Parameters
----------
left, right, top, bottom : float or None, optional
Extent of the subplots as a fraction of figure width or height.
wspace, hspace : float, optional
Spacing between the subplots as a fraction of the average subplot
width / height.
z is an unknown keywordNF)Úroot)ÚitemsÚ _AllowedKeysÚsetattrÚAttributeErrorrÚGcfÚfigsÚvaluesÚcanvasr3ÚaxesÚget_subplotspecrirlÚ
get_figureÚ
_set_positionÚ get_position)rÚkwargsÚ
figmanagerroÚssrSs rÚupdatezGridSpec.updateqð—LL“Nò C‰DˆAˆqؘ˜Õ sÐ*@Ð%AÓ Cô
,×1× Qˆ ×'×.×
QØ××-×GÓ(¨DÓ Ÿm™m°˜mÓØ××);Ñ);Ó)=×)JÑ)JÈ3Ó)OÕ 
Qñ Qrc ó:|€:|jDcic]}|tjd|zŒ}}tdi|¤Ž}nt j|j
«}|j di|jDcic]}|t||«Œc}¤Ž|Scc}wcc}w)a:
Return the `.SubplotParams` for the GridSpec.
In order of precedence the values are taken from
- non-*None* attributes of the GridSpec
- the provided *figure*
- :rc:`figure.subplot.*`
Note that the ``figure`` attribute of the GridSpec is always ignored.
úfigure.subplot.r2)r­ÚmplÚrcParamsÚ
SubplotParamsr•Ú subplotparsr¾Úgetattr)rr3ÚkwrÄs rr4zGridSpec.get_subplot_paramsð ˆ×ð”S—\\Ð"3°AÑ"5Ñ.ˆ-¨"Ñ-‰KäŸ)™) F×$6Ñ$6Ó7ˆKàˆ ×ÑÑN¸4×;LÑ;LÖM°a˜a¤¨¨qÓ!1ÑÐùò.ùò Ns BÁ8B cóZ|jDcgc]}t||«sŒ|Œc}Scc}w)
Return a list of the names of the subplot parameters explicitly set
in the GridSpec.
This is a subset of the attributes of `.SubplotParams`.
)r­)rs rÚlocally_modified_subplot_paramsz(GridSpec.locally_modified_subplot_params¤s'ð ×A¸¸aÕ0@’ÒAùÒAs(¡(c
óÞ||j«}tj||jtj|j|¬«|||||¬«}|r|j
di|¤Žyy)a
Adjust subplot parameters to give specified padding.
Parameters
----------
figure : `.Figure`
The figure.
renderer : `.RendererBase` subclass, optional
The renderer to be used.
pad : float
Padding between the figure edge and the edges of subplots, as a
fraction of the font-size.
h_pad, w_pad : float, optional
Padding (height/width) between edges of adjacent subplots.
Defaults to *pad*.
rect : tuple (left, bottom, right, top), default: None
(left, bottom, right, top) rectangle in normalized figure
coordinates that the whole subplots area (including labels) will
fit into. Default (None) is the whole figure.
N)Ú grid_spec)ÚpadÚh_padÚw_padÚrectr2)Ú
_get_rendererrÚget_tight_layout_figurer´Úget_subplotspec_listr¾)rr3ÚrendererrËs rÚ tight_layoutzGridSpec.tight_layout­slð, Ð Ø×-ˆHÜ× F—K‘KÜ × .¨v¯{©{ÀdÔ ˜# U°%¸dôDˆñ Ø ˆDK‰KÑ !˜  r) NNNNNNNNNr))NgHáz®Gñ?NNN) r$r rr­r4Ú
__classcell__©r#s@rrnrn/sBø„ñð-1Ø9=Ø%)Ø26õ46òlJ€LòQó8ò.Bð-1Ø<@÷"rrncó6eZdZdZ dˆfd„ ZddZdZˆxZS)ÚGridSpecFromSubplotSpeczx
GridSpec whose subplot layout parameters are inherited from the
location specified by a given SubplotSpec.
cóà||_||_t|t«r||_n t d«|jj
«j|_t|%||||¬«y)ak
Parameters
----------
nrows, ncols : int
Number of rows and number of columns of the grid.
subplot_spec : SubplotSpec
Spec from which the layout parameters are inherited.
wspace, hspace : float, optional
See `GridSpec` for more details. If not specified default values
(from the figure or rcParams) are used.
height_ratios : array-like of length *nrows*, optional
See `GridSpecBase` for details.
width_ratios : array-like of length *ncols*, optional
See `GridSpecBase` for details.
zVsubplot_spec must be type SubplotSpec, usually from GridSpec, or axes.get_subplotspec.r§N)
Ú_wspaceÚ_hspacer rÚ
_subplot_specÚ TypeErrorrlr3r) rrrÚ subplot_specrJrKrrr#s €rrz GridSpecFromSubplotSpec.__init__Òstø€ð&ˆŒ ؈Œ Ü l¤KÔ 0Ø!-ˆDÕ äðNóOð
Oð×(×7×>ˆŒ Ü
ј Ø&2Ø'4ð õ 6rcóˆ|j |jn*||jjntjd}|j
|j
n*||jj ntjd}|jj|«}|j\}}}}t||||||¬«S)z1Return a dictionary of subplot layout parameters.zfigure.subplot.hspacezfigure.subplot.wspace)rFrGrHrIrJrK) rKrJr¸ÚextentsrÃ) rr3rKrJÚfigboxrFrHrGrIs rr4z*GridSpecFromSubplotSpec.get_subplot_paramsòà"&§,¡,Ð":$—,,Ø4:Ð4Fv×)×—||Ð$;Ñ ð#'§,¡,Ð":$—,,Ø4:Ð4Fv×)×—||Ð$;Ñ ð×#×Ó8ˆØ#)§>¡>Ñ ˆˆfe˜ $¨eØ$*°Ø$*°6ô ;rcó6|jj«S)zY
Return the topmost `.SubplotSpec` instance associated with the subplot.
)rir*s rriz/GridSpecFromSubplotSpec.get_topmost_subplotspecsð×!×;r)NNNNr))r$r rr4ris@rr×Ís ø„ñð &*Ø26õ6ó@<rr×cóÄeZdZdZddZdZed«Zed«Z e jd«Z dZ d „Z ed
«Z
ed «Zd Zd
ZdZdZdZdZdZdZdZy)ra]
The location of a subplot in a `GridSpec`.
.. note::
Likely, you will never instantiate a `SubplotSpec` yourself. Instead,
you will typically obtain one from a `GridSpec` using item-access.
Parameters
----------
gridspec : `~matplotlib.gridspec.GridSpec`
The GridSpec, which the subplot is referencing.
num1, num2 : int
The subplot will occupy the *num1*-th cell of the given
*gridspec*. If *num2* is provided, the subplot will span between
*num1*-th cell and *num2*-th cell **inclusive**.
The index starts from 0.
Ncó.||_||_||_yr))Ú _gridspecr…r†)rÚgridspecr…r†s rrzSubplotSpec.__init__sØ!ˆŒØˆŒ ؈ rc
óà|j«d|jjd|jjd|jjd|jjd
S):z, ú])rlr7r{r|r8r*s rr'zSubplotSpec.__repr__"scØ×' —<<×& ¯ © ×(9Ñ(9Ð':¸—<<×& ¯ © ×(9Ñ(9Ð':¸ >rcó¸t|«dk(rS|\}t|t«r|St|t«st d|« t t t|««\}}}n6t|«dk(r|\}}}n!tjddt|«¬«tj|||«}|t|||¬«}t|t«r4t|«d k(r&td
|D««st d |«|\}}n5t|t«r
|dks|||zkDrt d ||zd
|«|x}}||dz
|S#t$rt d|«dwxYw)
Construct a `.SubplotSpec` from a parent `.Figure` and either
- a `.SubplotSpec` -- returned as is;
- one or three numbers -- a MATLAB-style subplot specifier.
rz>Single argument to subplot must be a three-digit integer, not NéÚsubplotz1 or 3)ÚtakesÚgivenrjrEc3ó<K|]}t|t«Œy­wr))r r)Ú.0Úns rú <genexpr>z1SubplotSpec._from_subplot_args.<locals>.<genexpr>Fsèø€Ò<°1”z !¤X×<ùsz3Subplot specifier tuple must contain integers, not z(num must be an integer with 1 <= num <= z, not )rr rrr ÚmapÚintr“rÚ nargs_errorrnrqrr) r3ÚargsÚargÚrowsÚcolsÚnumrpÚjs rÚ_from_subplot_argszSubplotSpec._from_subplot_args'sô ˆtŠ>؉DˆCܘ#œ{Ô
Ü ¤XÔ ð$Ø$' 
7Ü"%¤c¬3¨s«8Ó"4d™Cô
Y˜!Š^Ø"‰OˆD$™ä×" 9°HÄCÈÃIÔ
×
,¨V°T¸
@ˆØ
ˆ:ܘ$ ¨VÔ4ˆBÜ cœ5Ô !¤c¨#£h°!¢mÜÑ<¸Ô ØIÈ#ÈÐðð‰DˆA‰qä˜c¤8Ô°a²¸3ÀÀdÁº?Ü Ø>¸tÀD¹y¸JؘððˆKˆAØ!A‘#aˆyÐøô3ò
 ð$Ø$' -à26ð
7ús ÁEÅEcóJ|j |jS|jSr))Ú_num2r…r*s rr†zSubplotSpec.num2Wsà ŸJ™JÐ.ˆty‰yÐ>°D·J±JÐ>rcó||_yr))rÿ)rÚvalues rr†zSubplotSpec.num2[s àˆ
rcó|jSr))r*s rrlzSubplotSpec.get_gridspec_s Ø~‰~Ðrcóx|j«j«\}}|||j|jfS)a
Return the subplot geometry as tuple ``(n_rows, n_cols, start, stop)``.
The indices *start* and *stop* define the range of the subplot within
the `GridSpec`. *stop* is inclusive (i.e. for a single cell
``start == stop``).
)rlr0r…r†)rs rr0zSubplotSpec.get_geometrybs6ð×(×7‰
ˆˆdØT˜4Ÿ9™9 d§i¡iÐ/rcóˆ|j«j}t|j|z|j|zdz«S)z6The rows spanned by this subplot, as a `range` object.r)rlrr˜r…r†)rrs rr7zSubplotSpec.rowspanms<ð×)ˆÜT—YY ¯©°eÑ);¸aÑ)?Ó@rcó¨|j«j}t|j|z|j|zg«\}}t ||dz«S)z9The columns spanned by this subplot, as a `range` object.r)rlrÚsortedr…r†r˜)rrÚc1Úc2s rr8zSubplotSpec.colspanssPð×ô˜Ÿ UÑ*¨D¯I©I¸Ñ,=Ð?‰ˆˆBܘa™Ó Ð rcó4|jjdk(S©Nr)r7r{r*s rÚ is_first_rowzSubplotSpec.is_first_row|óØ|‰|×! &rcód|jj|j«jk(Sr))r7r|rlrr*s rÚ is_last_rowzSubplotSpec.is_last_rowó&Ø|‰|× Ñ  D×$5Ñ$5Ó$7×$=Ñ$=Ñ=rcó4|jjdk(Sr
)r8r{r*s rÚ is_first_colzSubplotSpec.is_first_colr rcód|jj|j«jk(Sr))r8r|rlrr*s rÚ is_last_colzSubplotSpec.is_last_col…rrcóž|j«}|j«\}}tj|j|j
g||f«\}}|j
|«\}}} }
||j«} ||j«} | |j«}
|
|j«}tj|
| || «S)zJ
Update the subplot position from ``figure.subplotpars``.
) rlr0rMÚ
unravel_indexr…r†rgÚminÚmaxrÚ from_extents)rr3rrrdrcrerfÚ
fig_bottomÚfig_topÚfig_leftÚ fig_rights rr¸zSubplotSpec.get_positionˆðר×.‰ ˆˆuÜ×% t§y¡y°$·)±)Ð&<¸uÀe¸M‰
ˆˆ × Ó  5ˆ X˜y¨*ð! Ñ&×,ˆ
ؘ4.×&ˆØ˜T?×(ˆØ˜*ˆ Ü× Ñ  ¨:°yÀ'ÓJrcó^|j«}t|d«r|j«S|S)zX
Return the topmost `SubplotSpec` instance associated with the subplot.
ri)rlrmri)rs rriz#SubplotSpec.get_topmost_subplotspec˜s1ð×Ü  × ˆKrc óÆ|j|j|jft|dt ««t|dt ««t|dt ««fk(S)z}