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«ZGd„d«ZGd„d e«ZGd
„d e«ZGd „d
«ZGd„d«Zy)aÓ
: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ó¦—eZdZdZdd„Zd„Zed„d¬«Zed„d ¬«Zd
„Z dd „Z
dd „Z d
„Z d„Z
d„Zd„Zd„Zed„«Zd„Zdddddœd„Zy)Ú 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)aŸ
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À%ÀÐKóMð
Mä˜%¤Ô*¨e°qªjÜØDÀUÀIÐNóPð
Pà#(¨%Ð ˆŒ �T”[Ø ×ј}Ô-Ø ×јlÕ+ócóJ—tt|j««dk7rd|j›�nd}tt|j««dk7rd|j›�nd}dj |j
j |j|j||z¬«S)Né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__9s¥€äœS ×!8Ñ!8Ó9Ó:¸aÒ?ð)¨×)@Ñ)@Ð(CÑDØEGð ôœC × 6Ñ 6Ó7Ó8¸AÒ=ð' t×'=Ñ'=Ð&@ÑAØCEð à7×>Ñ>Ø—N‘N×+Ñ+Ø—+‘+Ø—+‘+Ø  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…|||z…f}|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)zÂ
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)zÁ
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 }|jD�cgc]}||z‘Œ }}dg|g|dz
zz}tjtj||g«j«}| || |dz
zzz }| |z}||zt|j«z }|jD�cgc]}||z‘Œ }}dg|g|dz
zz}tjtj||g«j«}||z
jd«j \}}||zjd«j \}}||||fScc}wcc}w)aì
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ÚrÚ 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�s÷€ð ×(Ñ(Ó*‰ ˆˆuØ×0Ñ0°Ó5ˆØ×"Ñ"ˆØ×$Ñ$ˆØ×&Ñ&ˆØ× Ñ ˆØ×&Ñ&ˆØ×&Ñ&ˆØ˜D‘Lˆ ؘ6‘\ˆ
ð˜u v¨u°Q©wÑ'7Ñ7Ñ8ˆØ˜‘ˆØ˜‰~¤ D×$;Ñ$;Ó <Ñ<ˆØ*.×*AÑ*AÖB Q˜˜D›ÐBˆ ÐBØ�c˜e˜W¨¨a©Ñ0Ñ1ˆ Ü—)‘)œBŸO™O¨[¸,Ð,GÓH×MÑMÓNˆð˜e f¨e°A©gÑ&6Ñ6Ñ7ˆØ˜‘ˆØ˜‰~¤ D×$:Ñ$:Ó ;Ñ;ˆØ)-×)?Ñ)?Ö@ A�q˜4“xÐ@ˆ Ð@Ø�S˜U˜G u¨Q¡wÑ/Ñ0ˆ
Ü—)‘)œBŸO™O¨Z¸Ð,EÓF×KÑKÓLˆà!$ 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Ð8Ô9ð ×3Ñ3Ó5×BÑBÓD�BØ—?‘?Ó$¨°¨Ó6Ø’Ið ô˜˜u¨VÔ4Ð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Øsπ؈Hܘ#œuÔ%Ø!$§¡¨TÓ!2‘��t˜Qؘ%’<Ø  $¨¡(˜?Ð*Ü ð"9ó:ð:ð˜’7Ø ™*�Cؘ”?˜d’?Ø ˜8�Oð#àÐ%Ü$ v¨h¨Zð8-Ø-1¨F°+¸d¸Vð&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__Ôsµ€à×(Ñ(Ó*‰ ˆˆuò Cô( �cœ5Ô !ð
GØ‘��Bô×-Ñ-Ù˜B  qÓ)©:°b¸%ÀÓ+CÐDؘ�ó ‰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)rŽr�r�r�rˆr‰)r�r�T)Úskip_non_rectangular_axes)r�r�r)r3r r ÚstrrÚ
check_in_listÚcopyrMÚemptyr
rÚobjectÚrangeÚ add_subplotrPÚ_label_outer_xaxisÚ_label_outer_yaxisrxÚitemrŠ) rrˆr‰rŠr‹r3Úaxarrr�r�Ú shared_withros rÚsubplotszGridSpecBase.subplotsùsÆ€ð—‘ˆà ˆ>Üð<ó=ð
=ô˜&¤#Ô&Ù$‘U¨&ˆFܘ&¤#Ô&Ù$‘U¨&ˆFä ×ÑÒEØ"(°õ 9à Р؈Jà—_‘_Ó&ˆ
ô—‘˜$Ÿ+™+ t§{¡{Ð3¼6ÔBˆÜ˜Ÿ™Ó%ò 2ˆCܘTŸ[™[Ó)ò
2�Ø'+°E¸$±KØ&+¨C°¨F¡m¸EÀ!ÀSÀ&¹MñK� à'2°6Ñ':�
˜8Ñ$Ø'2°6Ñ':�
˜8Ñ$Ø"4 &×"4Ñ"4ؘ˜c˜‘Nñ#2Ø&0ñ#2��c˜3�h’ñ 
2ð 2ð �^Ñ #Ø—j‘jò
F�Ø×%Ñ%ÀÐ%ÕEð
Fà �^Ñ #Ø—j‘jò
F�Ø×%Ñ%ÀÐ%ÕEð
Fñ ð$)§:¡:°¢?�5—:‘:“<Ð G¸¿
¹
»Ð GðˆLr)NNr))rr)r$Ú
__module__Ú __qualname__Ú__doc__rr'Úpropertyrrr0r4r<rr?rrBrgÚ staticmethodrqr‡rŸr2rrr r s‡„ñó
,ò2
ñ
Ñ-Ø:ô
<€Eá Ñ-Ø=ô
?€Eò(ó 
óò .ò&ò 0ò'ò-<ð^ñ5óð5ò(#-ðJ"'¨u¸dØ õ3rr cóT‡—eZdZdZ dˆfd„ Zgd¢Zd„Zd d„Zd„Z d
d„Z ˆ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)að
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ÚkÚvÚ
figmanagerroÚssrSs rÚupdatezGridSpec.updateqsþ€ð—L‘L“Nò C‰DˆAˆqØ�D×%Ñ%Ñ%ܘ˜a Õ#ä$¨ sÐ*@Ð%AÓBÐBð  Cô
)×,Ñ,×1Ñ1×8Ñ8Ó:ò QˆJØ ×'Ñ'×.Ñ.×3Ñ3ò
Q�Ø×%Ñ%Ó'Ñ3Ø×+Ñ+Ó-×EÑEÓG�BØ—‘Ó(¨DÓ0Ø Ÿm™m°˜mÓ7˜Ø×(Ñ(¨×);Ñ);Ó)=×)JÑ)JÈ3Ó)OÕPñ 
Qñ Qrc ó:—|€:|jD�cic]}|tjd|z“Œ}}tdi|¤Ž}nt j|j
«}|j di|jD�cic]}|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)rr3rºÚkwrÄs rr4zGridSpec.get_subplot_params�s¢€ð ˆ>à×,Ñ,ö.Øð”S—\‘\Ð"3°AÑ"5Ñ6Ñ6ð.ˆBð.ä'Ñ-¨"Ñ-‰KäŸ)™) F×$6Ñ$6Ó7ˆKàˆ ×ÑÑN¸4×;LÑ;LÖM°a˜a¤¨¨qÓ!1Ñ1ÒMÒNàÐùò.ùò Ns ‘BÁ8B cóZ—|jD�cgc]}t||«sŒ|‘Œc}Scc}w)z¯
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­rÅ)rrºs rÚlocally_modified_subplot_paramsz(GridSpec.locally_modified_subplot_params¤s'€ð ×,Ñ,ÖA�a´¸¸aÕ0@’ÒAÐ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ËrÌrÍrÎr¹s rÚ tight_layoutzGridSpec.tight_layout­sl€ð, Ð Ø×+Ñ+Ó-ˆHÜ×6Ñ6Ø �F—K‘KÜ × .Ñ .¨v¯{©{ÀdÔ KØ ˜# U°%¸dôDˆñ Ø ˆD�K‰KÑ !˜&Ó !ð r) NNNNNNNNNr))NgHáz®Gñ?NNN) r$r r¡r¢rr­r¾r4rÈrÓÚ
__classcell__©r#s@rrnrn/sBø„ñð-1Ø9=Ø%)Ø26õ46òlJ€LòQó8ò.Bð-1Ø<@÷"rrncó6‡—eZdZdZ dˆfd„ Zdd„Zd„Zˆ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¨r) rrrÚ subplot_specrJrKrrr#s €rrz GridSpecFromSubplotSpec.__init__Òstø€ð&ˆŒ ؈Œ Ü �l¤KÔ 0Ø!-ˆDÕ äðNóOð
Oð×(Ñ(×5Ñ5Ó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) rÚrÄrKrÁrÂrÙrJrÛr¸ÚextentsrÃ) rr3rKrJÚfigboxrFrHrGrIs rr4z*GridSpecFromSubplotSpec.get_subplot_paramsòsµ€à"&§,¡,Ð":�$—,’,Ø4:Ð4F�v×)Ñ)×0Ò0Ü—|‘|Ð$;Ñ<ð ð#'§,¡,Ð":�$—,’,Ø4:Ð4F�v×)Ñ)×0Ò0Ü—|‘|Ð$;Ñ<ð ð×#Ñ#×0Ñ0°Ó8ˆØ#)§>¡>Ñ ˆˆf�e˜Sä $¨eØ$*°Ø$*°6ô;ð ;rcó6—|jj«S)zY
Return the topmost `.SubplotSpec` instance associated with the subplot.
)rÛrir*s rriz/GridSpecFromSubplotSpec.get_topmost_subplotspecs€ð×!Ñ!×9Ñ9Ó;Ð;r)NNNNr))r$r r¡r¢rr4rirÔrÕs@rr×r×Ís ø„ñð &*Ø26õ6ó@;ö <rr×cóÄ—eZdZdZdd„Zd„Zed„«Zed„«Z e jd„«Z d„Z d „Z ed
„«Z
ed „«Zd „Zd
„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zy)r�a]
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|jj›d|jj›d|jj›d|jj›d�
S)Nú[ú:z, ú])rlr7r{r|r8r*s rr'zSubplotSpec.__repr__"sc€Ø×$Ñ$Ó&Ð' qØ—<‘<×%Ñ%Ð& a¨¯ © ×(9Ñ(9Ð':¸"Ø—<‘<×%Ñ%Ð& a¨¯ © ×(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 ||z›d
|›�«‚|x}}||dz
|S#t$rt d|›�«d‚wxYw)zÂ
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×.Ñ<ùs‚z3Subplot specifier tuple must contain integers, not z(num must be an integer with 1 <= num <= z, not )rr r�rr ÚmapÚintr“rÚ nargs_errorrnrqrr�) r3ÚargsÚargÚrowsÚcolsÚnumrpÚiÚjs rÚ_from_subplot_argszSubplotSpec._from_subplot_args's�€ô ˆt‹9˜Š>؉DˆCܘ#œ{Ô+Ø�
Ü ¤XÔ.Ü ð$Ø$' 7ð,ó-ð-ð
7Ü"%¤c¬3¨s«8Ó"4‘��d™Cô
�‹Y˜!Š^Ø"‰OˆD�$™ä×"Ñ" 9°HÄCÈÃIÔNÐ Nä
×
,Ñ
,¨V°T¸4Ó
@ˆØ
ˆ:ܘ$ ¨VÔ4ˆBÜ �cœ5Ô !¤c¨#£h°!¢mÜÑ<¸Ô<Ô<Ü ØIÈ#ÈÐOóðð‰DˆA‰qä˜c¤8Ô,°°a²¸3ÀÀdÁº?Ü Ø>¸tÀD¹y¸kðJؘ'ð#óððˆKˆA�Ø�!�A‘#�aˆyÐøô3ò
7Ü ð$Ø$' 7ð,ó-à26ð7ð
7ús ÁEÅEcóJ—|j€ |jS|jSr))Ú_num2r…r*s rr†zSubplotSpec.num2Ws€à ŸJ™JÐ.ˆt�y‰yÐ>°D·J±JÐ>rcó—||_yr))rÿ)rÚvalues rr†zSubplotSpec.num2[s €àˆ�
rcó—|jSr))rä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†)rrørùs rr0zSubplotSpec.get_geometrybs6€ð×&Ñ&Ó(×5Ñ5Ó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—Y‘Y %Ñ'¨¯©°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Ü�R˜˜a™Ó Ð rcó4—|jjdk(S©Nr)r7r{r*s rÚ is_first_rowzSubplotSpec.is_first_row|ó€Ø�|‰|×!Ñ! QÑ&Ð&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_col‚r 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)rr3rårrrørùrdrcrerfÚ
fig_bottomÚfig_topÚfig_leftÚ fig_rights rr¸zSubplotSpec.get_positionˆsÉ€ð×$Ñ$Ó&ˆØ×,Ñ,Ó.‰ ˆˆuÜ×%Ñ% t§y¡y°$·)±)Ð&<¸uÀe¸nÓM‰
ˆˆdà × 'Ñ '¨Ó /ñ 5ˆ �X˜y¨*ð! Ñ&×*Ñ*Ó,ˆ
ؘ4‘.×$Ñ$Ó&ˆØ˜T‘?×&Ñ&Ó(ˆØ˜tÑ$×(Ñ(Ó*ˆ Ü× Ñ  ¨:°yÀ'ÓJÐJrcó^—|j«}t|d«r|j«S|S)zX
Return the topmost `SubplotSpec` instance associated with the subplot.
ri)rlrmri)rrås rriz#SubplotSpec.get_topmost_subplotspec˜s1€ð×$Ñ$Ó&ˆÜ �8Ð6Ô 7Ø×3Ñ3Ó5Ð 5àˆKrc óÆ—|j|j|jft|dt ««t|dt ««t|dt ««fk(S)z}