ó
    {ñ:iZt  ã                   óà   • S r SSKrSSKrSSKJr  SSKrSSKrSSKJ	r	J
r
Jr  SSKJr  \R                  " \5      r " S S5      r " S S	\5      r " S
 S\5      r " S S5      r " S S5      rg)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                   óª   • \ rS rSrSrSS jrS r\" S SS9r\" S	 S
S9r	S r
SS jrSS jrS rS rS rS rS r\S 5       rS rSSSSS.S jrSrg)ÚGridSpecBaseé   za
A base class of GridSpec that specifies the geometry of the grid
that a subplot will be placed.
Nc                 ó  • [        U[        5      (       a  US::  a  [        SU< 35      e[        U[        5      (       a  US::  a  [        SU< 35      eXsU l        U l        U R                  U5        U R                  U5        g)a7  
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.
r   z/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/srv/projetos/modelo_ml_acdoc/venv/lib/python3.13/site-packages/matplotlib/gridspec.pyÚ__init__ÚGridSpecBase.__init__    s†   € ô ˜%¤×*Ñ*¨e°q«jÜØAÀ%ÁÐKóMð Mä˜%¤×*Ñ*¨e°q«jÜØDÀUÁIÐNóPð Pà#(Ð ˆŒ�T”[Ø×Ñ˜}Ô-Ø×Ñ˜lÕ+ó    c                 óJ  • [        [        U R                  5      5      S:w  a  SU R                  < 3OSn[        [        U R                  5      5      S:w  a  SU R                  < 3OSnSR	                  U R
                  R                  U R                  U R                  X-   S9$ )Né   z, height_ratios=Ú z, width_ratios=z&{clsname}({nrows}, {ncols}{optionals}))Úclsnamer   r   Ú	optionals)	ÚlenÚsetÚ_row_height_ratiosÚ_col_width_ratiosÚformatÚ	__class__Ú__name__r   r   )r   Ú
height_argÚ	width_args      r   Ú__repr__ÚGridSpecBase.__repr__9   s£   € äœS ×!8Ñ!8Ó9Ó:¸aÓ?ð )¨×)@Ñ)@Ñ(CÑDØEGð 	ô œC × 6Ñ 6Ó7Ó8¸AÓ=ð ' t×'=Ñ'=Ñ&@ÑAØCEð 	à7×>Ñ>Ø—N‘N×+Ñ+Ø—+‘+Ø—+‘+Ø Ñ,ð	 ?ð ð 	r   c                 ó   • U R                   $ ©N)r   ©r   s    r   Ú<lambda>ÚGridSpecBase.<lambda>E   ó   €  $§+¢+r   zThe number of rows in the grid.)Údocc                 ó   • U R                   $ r,   )r   r-   s    r   r.   r/   G   r0   r   z"The number of columns in the grid.c                 ó2   • U R                   U R                  4$ )zG
Return a tuple containing the number of rows and columns in the grid.
)r   r   r-   s    r   Úget_geometryÚGridSpecBase.get_geometryJ   s   € ð �{‰{˜DŸK™KÐ'Ð'r   c                 ó   • g r,   © )r   Úfigures     r   Úget_subplot_paramsÚGridSpecBase.get_subplot_paramsP   s   € àr   c                 ó*   • Uu  pEXXB-   2XUU-   24   nU$ )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.
r7   )r   ÚlocÚrowspanÚcolspanÚloc1Úloc2Úsubplotspecs          r   Únew_subplotspecÚGridSpecBase.new_subplotspecT   s,   € ð ‰
ˆØ ¡Ð,¨d¸±<Ð.?Ð?Ñ@ˆØÐr   c                 ó€   • Uc  S/U R                   -  nO$[        U5      U R                   :w  a  [        S5      eXl        g)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)``.
Nr   zTExpected the given number of width ratios to match the number of columns of the grid)r   r    r   r#   )r   r   s     r   r   ÚGridSpecBase.set_width_ratiosd   sF   € ð ÑØ˜3 §¡Ñ,‰LÜ�Ó $§+¡+Ó-Üð Gó Hð Hà!-Õr   c                 ó   • U R                   $ )zW
Return the width ratios.

This is *None* if no width ratios have been set explicitly.
)r#   r-   s    r   Úget_width_ratiosÚGridSpecBase.get_width_ratiosr   s   € ð ×%Ñ%Ð%r   c                 ó€   • Uc  S/U R                   -  nO$[        U5      U R                   :w  a  [        S5      eXl        g)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)``.
Nr   zRExpected the given number of height ratios to match the number of rows of the grid)r   r    r   r"   )r   r   s     r   r   ÚGridSpecBase.set_height_ratiosz   sF   € ð Ñ Ø˜C $§+¡+Ñ-‰MÜ�Ó 4§;¡;Ó.Üð Dó Eð Eà"/Õr   c                 ó   • U R                   $ )zY
Return the height ratios.

This is *None* if no height ratios have been set explicitly.
)r"   r-   s    r   Úget_height_ratiosÚGridSpecBase.get_height_ratiosˆ   s   € ð ×&Ñ&Ð&r   c                 óÀ  • U R                  5       u  p#U R                  U5      nUR                  nUR                  nUR                  nUR
                  nUR                  n	UR                  n
Xe-
  nX‡-
  nXÂX¢S-
  -  -   -  nX­-  nXÒ-  [        U R                  5      -  nU R                   Vs/ s H  nUU-  PM
     nnS/U/US-
  -  -   n[        R                  " [        R                  " UU/5      R                  5      nX³X“S-
  -  -   -  nU	U-  nUU-  [        U R                  5      -  nU R                   Vs/ s H  nUU-  PM
     nnS/U/US-
  -  -   n[        R                  " [        R                  " UU/5      R                  5      nUU-
  R                  S5      R                   u  nnUU-   R                  S5      R                   u  nnUUUU4$ s  snf s  snf )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.
r   r   )éÿÿÿÿé   )r4   r9   ÚleftÚrightÚbottomÚtopÚwspaceÚhspaceÚsumr"   ÚnpÚcumsumÚcolumn_stackÚflatr#   ÚreshapeÚT)r   Úfigr   r   Úsubplot_paramsrQ   rR   rS   rT   rU   rV   Ú	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_positionsÚGridSpecBase.get_grid_positions�   së  € ð  ×(Ñ(Ó*‰ˆØ×0Ñ0°Ó5ˆØ×"Ñ"ˆØ×$Ñ$ˆØ×&Ñ&ˆØ× Ñ ˆØ×&Ñ&ˆØ×&Ñ&ˆØ‘Lˆ	Ø‘\ˆ
ð  v°Q©wÑ'7Ñ7Ñ8ˆØ‘ˆØ‰~¤ D×$;Ñ$;Ó <Ñ<ˆØ*.×*AÒ*AÓBÒ*A Q˜˜DœÑ*AˆÐBØ�c˜e˜W¨¨a©Ñ0Ñ1ˆÜ—)’)œBŸOšO¨[¸,Ð,GÓH×MÑMÓNˆð  f°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ùò As   Â,GÄ:Gc                 óþ   • U R                  5        H`  nUR                  5       nUc  M  [        US5      (       a  UR                  5       R                  5       nUR	                  5       X4:X  d  M^  Us  $    [        XU S9$ )zW
Check if the figure already has a gridspec with these dimensions,
or create a new one
Úget_topmost_subplotspec©r8   )Úget_axesÚget_gridspecÚhasattrru   r4   ÚGridSpec)r8   r   r   ÚaxÚgss        r   Ú_check_gridspec_existsÚ#GridSpecBase._check_gridspec_exists¿   sr   € ð —/‘/Ö#ˆBØ—‘Ó"ˆBØ‹~Ü˜2Ð8×9Ñ9ð ×3Ñ3Ó5×BÑBÓD�BØ—?‘?Ó$¨¨Õ6Ø’Iñ $ô ˜¨VÑ4Ð4r   c                 ó&  • U R                  5       u  p#S n[        U[        5      (       a0   Uu  pV[        R
                  " U" XRS5      U" XcS5      /X#45      u  p‰OU" XU-  S5      u  p‰[        XU	5      $ ! [         a  n[        S5      UeSnAff = f)z,Create and return a `.SubplotSpec` instance.c                 ó  • U n[        U [        5      (       a*  U R                  U5      u  pEnXT:”  a  XES-
  4$ [        S5      eU S:  a  X-   n SU s=::  a	  U:  a   X 4$   Ub  [        SU SU SU 35      e[        SU SU 35      e)Nr   z=GridSpec slice would result in no space allocated for subplotr   zindex 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   Ú
_normalizeÚ,GridSpecBase.__getitem__.<locals>._normalizeØ   sÈ   € ØˆHÜ˜#œu×%Ñ%Ø!$§¡¨TÓ!2‘�˜QØ“<Ø ¨¡(˜?Ð*Ü ð "9ó :ð :ð ˜“7Ø™*�CØ˜•?˜d”?Ø˜8�Oð #àÑ%Ü$ v¨h¨Zð 8-Ø-1¨F°+¸d¸Vð&Eó Fð Fô % v¨h¨Zð 8;Ø;?¸&ð&Bó Cð Cr   zUnrecognized subplot specNr   r   )r4   r   Útupler   rX   Úravel_multi_indexÚSubplotSpec)
r   r„   r   r   r‹   Úk1Úk2ÚerrÚnum1Únum2s
             r   Ú__getitem__ÚGridSpecBase.__getitem__Ô   s¨   € à×(Ñ(Ó*‰ˆò	Cô( �cœ5×!Ñ!ðGØ‘�ô ×-Ò-Ù˜B qÓ)©:°bÀÓ+CÐDØ�ó ‰JˆD�$ñ $ C°©¸Ó=‰JˆDä˜4 tÓ,Ð,øô ó GÜ Ð!<Ó=À3ÐFûðGús   ¬A5 Á5
BÁ?BÂBFT)ÚsharexÚshareyÚsqueezeÚ
subplot_kwc                óf  • U R                   nUc  [        S5      e[        U[        5      (       d  U(       a  SOSn[        U[        5      (       d  U(       a  SOSn[        R
                  " / SQXS9  Uc  0 nUR                  5       n[        R                  " U R                  U R                  4[        S9n[        U R                  5       H[  n[        U R                  5       H?  nSUS   XgS	4   US	U4   S
.n	X‘   US'   X’   US'   UR                  " XU4   40 UD6XgU4'   MA     M]     US;   a"  UR                   H  n
U
R                  SS9  M     US;   a"  UR                   H  n
U
R!                  SS9  M     U(       a0  UR"                  S:X  a  UR%                  5       $ UR'                  5       $ U$ )zy
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)r   r   r   )r�   rœ   rž   rŸ   r—   r˜   )rŸ   rœ   T)Úskip_non_rectangular_axes)rž   rœ   r   )r8   r   r   Ústrr   Úcheck_in_listÚcopyrX   Úemptyr   r   ÚobjectÚrangeÚadd_subplotr[   Ú_label_outer_xaxisÚ_label_outer_yaxisr…   Úitemr™   )r   r—   r˜   r™   rš   r8   Úaxarrrž   rŸ   Úshared_withr{   s              r   ÚsubplotsÚGridSpecBase.subplotsù   s¦  € ð —‘ˆà‰>Üð <ó =ð =ô ˜&¤#×&Ñ&Þ$‘U¨&ˆFÜ˜&¤#×&Ñ&Þ$‘U¨&ˆFä×ÒÒEØ"(ò	9àÑØˆJà—_‘_Ó&ˆ
ô —’˜$Ÿ+™+ t§{¡{Ð3¼6ÑBˆÜ˜Ÿ™Ö%ˆCÜ˜TŸ[™[Ö)�Ø'+°E¸$±KØ&+°¨F¡m¸EÀ!ÀSÀ&¹MñK�à'2Ñ':�
˜8Ñ$Ø'2Ñ':�
˜8Ñ$Ø"(×"4Ò"4Ø˜c˜‘Nñ#2Ø&0ñ#2�˜3�h“ó *ñ &ð �^Ó#Ø—j”j�Ø×%Ñ%ÀÐ%ÓEñ !à�^Ó#Ø—j”j�Ø×%Ñ%ÀÐ%ÓEñ !ö ð $)§:¡:°£?�5—:‘:“<ÐG¸¿¹»ÐGð ˆLr   )r#   r   r   r"   )NNr,   )r   r   )r&   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r)   Úpropertyr   r   r4   r9   rB   r   rG   r   rL   rr   Ústaticmethodr}   r•   r®   Ú__static_attributes__r7   r   r   r	   r	      sŒ   † ñô
,ò2
ñ Ñ-Ø:ñ<€EáÑ-Ø=ñ?€Eò(ôôò .ò&ò0ò'ò-<ð^ ñ5ó ð5ò(#-ðJ "'¨u¸dØ ÷3ð 3r   r	   c                   ód   ^ • \ rS rSrSr    S
U 4S jjr/ SQrS rSS jrS r	  SS jr
S	rU =r$ )rz   i/  zü
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                 óx   >• X@l         XPl        X`l        Xpl        X€l        X�l        X0l        [        TU ]!  XU
US9  g)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.

©r   r   N)	rQ   rS   rR   rT   rU   rV   r8   Úsuperr   )r   r   r   r8   rQ   rS   rR   rT   rU   rV   r   r   r%   s               €r   r   ÚGridSpec.__init__9  sC   ø€ ðT Œ	ØŒØŒ
ØŒØŒØŒØŒä‰Ñ˜Ø&2Ø'4ð 	ò 	6r   ©rQ   rS   rR   rT   rU   rV   c                 ó<  • UR                  5        H.  u  p#X R                  ;   a  [        XU5        M"  [        U S35      e   [        R
                  R                  R                  5        H®  nUR                  R                  R                   H‡  nUR                  5       c  M  UR                  5       R                  5       nUR                  5       U :X  d  MJ  UR                  SS9nUR                  UR                  5       R!                  U5      5        M‰     M°     g)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Úcanvasr8   ÚaxesÚget_subplotspecru   rx   Ú
get_figureÚ_set_positionÚget_position)r   ÚkwargsÚkÚvÚ
figmanagerr{   Ússr^   s           r   ÚupdateÚGridSpec.updateq  sã   € ð —L‘L–N‰DˆAØ×%Ñ%Ó%Ü˜ Ö#ä$¨ sÐ*@Ð%AÓBÐBñ	 #ô
 )×,Ñ,×1Ñ1×8Ñ8Ö:ˆJØ ×'Ñ'×.Ñ.×3Ô3�Ø×%Ñ%Ó'Ó3Ø×+Ñ+Ó-×EÑEÓG�BØ—‘Ó(¨DÕ0Ø Ÿm™m°˜mÐ7˜Ø×(Ñ(¨×);Ñ);Ó)=×)JÑ)JÈ3Ó)OÖPó 4ò ;r   c                 óF  • Uc=  U R                    Vs0 s H  nU[        R                  SU-      _M     nn[        S0 UD6nO [        R                  " UR
                  5      nUR                  " S0 U R                    Vs0 s H  o"[        X5      _M     snD6  U$ s  snf s  snf )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.r7   )rÀ   ÚmplÚrcParamsÚSubplotParamsr¤   ÚsubplotparsrÑ   Úgetattr)r   r8   rÍ   ÚkwrØ   s        r   r9   ÚGridSpec.get_subplot_params�  s¥   € ð ‰>à×,Ò,ó.Ú,�að ”S—\‘\Ð"3°AÑ"5Ñ6Ò6Ù,ð ð .ä'Ñ-¨"Ñ-‰KäŸ)š) F×$6Ñ$6Ó7ˆKà×ÒÑN¸4×;LÒ;LÓMÒ;L°a¤¨Ó!1Ò1Ñ;LÑMÒNàÐùò.ùò Ns   ’!BÁ=Bc                 ój   • U R                    Vs/ s H  n[        X5      (       d  M  UPM     sn$ s  snf )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Ù   )r   rÍ   s     r   Úlocally_modified_subplot_paramsÚ(GridSpec.locally_modified_subplot_params¤  s+   € ð  ×,Ò,ÓAÒ,�a´¸×0@—Ñ,ÑAÐAùÒAs   �0§0c                 óÜ   • Uc  UR                  5       n[        R                  " XR                  [        R                  " UR                  U S9X#XEUS9nU(       a  U R
                  " S0 UD6  gg)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Úrectr7   )Ú_get_rendererr   Úget_tight_layout_figurerÇ   Úget_subplotspec_listrÑ   )r   r8   Úrendererrá   râ   rã   rä   rÌ   s           r   Útight_layoutÚGridSpec.tight_layout­  sd   € ð, ÑØ×+Ñ+Ó-ˆHÜ×6Ò6Ø—K‘KÜ×.Ò.¨v¯{©{ÀdÑKØ U¸dñDˆö Ø�KŠKÑ!˜&Ó!ð r   )rS   r8   rV   rQ   rR   rT   rU   )	NNNNNNNNNr,   )NgHáz®Gñ?NNN)r&   r°   r±   r²   r³   r   rÀ   rÑ   r9   rÝ   ré   r¶   Ú__classcell__©r%   s   @r   rz   rz   /  sG   ø† ñð -1Ø9=Ø%)Ø26÷46òl J€LòQô8ò.Bð -1Ø<@÷"ò "r   rz   c                   óD   ^ • \ rS rSrSr  SU 4S jjrSS jrS rSrU =r	$ )	ÚGridSpecFromSubplotSpeciÍ  zl
GridSpec whose subplot layout parameters are inherited from the
location specified by a given SubplotSpec.
c                 óÜ   >• X@l         XPl        [        U[        5      (       a  X0l        O[        S5      eU R                  R                  5       R                  U l        [        TU ]%  XUUS9  g)aû  
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Ú	TypeErrorrx   r8   rº   r   )	r   r   r   Úsubplot_specrU   rV   r   r   r%   s	           €r   r   Ú GridSpecFromSubplotSpec.__init__Ò  so   ø€ ð& ŒØŒÜ�l¤K×0Ñ0Ø!-ÕäðNóOð Oð ×(Ñ(×5Ñ5Ó7×>Ñ>ˆŒÜ‰Ñ˜Ø&2Ø'4ð 	ò 	6r   c           	      ó€  • U R                   b  U R                   O+Ub  UR                  R                  O[        R                  S   nU R
                  b  U R
                  O+Ub  UR                  R                  O[        R                  S   nU R                  R                  U5      nUR                  u  pVpx[        XWXhX2S9$ )z1Return a dictionary of subplot layout parameters.zfigure.subplot.hspacezfigure.subplot.wspace)rQ   rR   rS   rT   rU   rV   )rñ   rØ   rV   rÕ   rÖ   rð   rU   rò   rË   Úextentsr×   )	r   r8   rV   rU   ÚfigboxrQ   rS   rR   rT   s	            r   r9   Ú*GridSpecFromSubplotSpec.get_subplot_paramsò  s«   € à"&§,¡,Ñ":�$—,’,Ø4:Ñ4F�v×)Ñ)×0Ò0Ü—|‘|Ð$;Ñ<ð 	ð #'§,¡,Ñ":�$—,’,Ø4:Ñ4F�v×)Ñ)×0Ò0Ü—|‘|Ð$;Ñ<ð 	ð ×#Ñ#×0Ñ0°Ó8ˆØ#)§>¡>Ñ ˆ�eä $Ø$*Ø$*ñ;ð 	;r   c                 ó6   • U R                   R                  5       $ )zI
Return the topmost `.SubplotSpec` instance associated with the subplot.
)rò   ru   r-   s    r   ru   Ú/GridSpecFromSubplotSpec.get_topmost_subplotspec  s   € ð ×!Ñ!×9Ñ9Ó;Ð;r   )rñ   rò   rð   r8   )NNNNr,   )
r&   r°   r±   r²   r³   r   r9   ru   r¶   rë   rì   s   @r   rî   rî   Í  s%   ø† ñð &*Ø26÷6ô@;÷ <ð <r   rî   c                   óÎ   • \ rS rSrSrSS jrS r\S 5       r\	S 5       r
\
R                  S 5       r
S	 rS
 r\	S 5       r\	S 5       rS rS rS rS rS rS rS rS rS rSrg)r�   i	  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                 ó(   • Xl         X l        X0l        g r,   )Ú	_gridspecr“   r”   )r   Úgridspecr“   r”   s       r   r   ÚSubplotSpec.__init__  s   € Ø!ŒØŒ	Ø�	r   c           
      óà   • U R                  5        SU R                  R                   SU R                  R                   SU R                  R                   SU R                  R                   S3
$ )NÚ[Ú:z, Ú])rx   r=   rˆ   r‰   r>   r-   s    r   r)   ÚSubplotSpec.__repr__"  sc   € Ø×$Ñ$Ó&Ð' qØ—<‘<×%Ñ%Ð& a¨¯©×(9Ñ(9Ð':¸"Ø—<‘<×%Ñ%Ð& a¨¯©×(9Ñ(9Ð':¸!ð=ð 	>r   c                 óâ  • [        U5      S:X  a]  Uu  n[        U[        5      (       a  U$ [        U[        5      (       d  [	        SU< 35      e [        [        [        U5      5      u  p4nO4[        U5      S:X  a  Uu  p4nO[        R                  " SS[        U5      S9e[        R                  XU5      nUc
  [        X4U S9n[        U[        5      (       a9  [        U5      S	:X  a*  [        S
 U 5       5      (       d  [	        SU 35      eUu  pxO:[        U[        5      (       a  US:  d  XSU-  :”  a  [	        SX4-   SU< 35      eU=pxXgS-
  U $ ! [         a    [	        SU< 35      Sef = f)z¢
Construct a `.SubplotSpec` from a parent `.Figure` and either

- a `.SubplotSpec` -- returned as is;
- one or three numbers -- a MATLAB-style subplot specifier.
r   z>Single argument to subplot must be a three-digit integer, not Né   Úsubplotz1 or 3)ÚtakesÚgivenrv   rP   c              3   óB   #   • U  H  n[        U[        5      v •  M     g 7fr,   )r   r   )Ú.0Úns     r   Ú	<genexpr>Ú1SubplotSpec._from_subplot_args.<locals>.<genexpr>F  s   é € Ð<º°1”z !¤X×.Ð.ºùs   ‚z3Subplot specifier tuple must contain integers, not z(num must be an integer with 1 <= num <= z, not )r    r   r�   r   r   ÚmapÚintr¢   r   Únargs_errorrz   r}   r�   rœ   )	r8   ÚargsÚargÚrowsÚcolsÚnumr|   ÚiÚjs	            r   Ú_from_subplot_argsÚSubplotSpec._from_subplot_args'  sŽ  € ô ˆt‹9˜‹>Ø‰DˆCÜ˜#œ{×+Ñ+Ø�
Ü ¤X×.Ñ.Ü ð$Ø$'¡7ð,ó-ð -ð7Ü"%¤c¬3¨s«8Ó"4‘�™Cô
 �‹Y˜!‹^Ø"‰OˆD™ä×"Ò" 9°HÄCÈÃIÑNÐNä×,Ñ,¨V¸4Ó@ˆØ‰:Ü˜$¨VÑ4ˆBÜ�cœ5×!Ñ!¤c¨#£h°!£mÜÑ<¹Ó<×<Ñ<Ü ØIÈ#ÈÐOóð ð ‰DˆAˆqä˜c¤8×,Ñ,°°a³¸3ÀdÁ»?Ü Ø>¸t¹y¸kð JØ™'ð#óð ð ˆKˆAØ�A‘#�aˆyÐøô3 ó 7Ü ð$Ø$'¡7ð,ó-à26ð7ð7ús   ÁE ÅE.c                 óL   • U R                   c  U R                  $ U R                   $ r,   )Ú_num2r“   r-   s    r   r”   ÚSubplotSpec.num2W  s   € à ŸJ™JÑ.ˆt�y‰yÐ>°D·J±JÐ>r   c                 ó   • Xl         g r,   )r  )r   Úvalues     r   r”   r  [  s   € à�
r   c                 ó   • U R                   $ r,   )rþ   r-   s    r   rx   ÚSubplotSpec.get_gridspec_  s   € Ø�~‰~Ðr   c                 ót   • U R                  5       R                  5       u  pXU R                  U R                  4$ )zà
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``).
)rx   r4   r“   r”   )r   r  r  s      r   r4   ÚSubplotSpec.get_geometryb  s2   € ð ×&Ñ&Ó(×5Ñ5Ó7‰
ˆØ˜4Ÿ9™9 d§i¡iÐ/Ð/r   c                 óˆ   • U R                  5       R                  n[        U R                  U-  U R                  U-  S-   5      $ )z6The rows spanned by this subplot, as a `range` object.r   )rx   r   r§   r“   r”   )r   r   s     r   r=   ÚSubplotSpec.rowspanm  s<   € ð ×!Ñ!Ó#×)Ñ)ˆÜ�T—Y‘Y %Ñ'¨¯©°eÑ);¸aÑ)?Ó@Ð@r   c                 ó¤   • U R                  5       R                  n[        U R                  U-  U R                  U-  /5      u  p#[        X#S-   5      $ )z9The columns spanned by this subplot, as a `range` object.r   )rx   r   Úsortedr“   r”   r§   )r   r   Úc1Úc2s       r   r>   ÚSubplotSpec.colspans  sL   € ð ×!Ñ!Ó#×)Ñ)ˆô ˜Ÿ™ UÑ*¨D¯I©I¸Ñ,=Ð>Ó?‰ˆÜ�R˜a™Ó Ð r   c                 ó4   • U R                   R                  S:H  $ ©Nr   )r=   rˆ   r-   s    r   Úis_first_rowÚSubplotSpec.is_first_row|  ó   € Ø�|‰|×!Ñ! QÑ&Ð&r   c                 ód   • U R                   R                  U R                  5       R                  :H  $ r,   )r=   r‰   rx   r   r-   s    r   Úis_last_rowÚSubplotSpec.is_last_row  ó&   € Ø�|‰|× Ñ  D×$5Ñ$5Ó$7×$=Ñ$=Ñ=Ð=r   c                 ó4   • U R                   R                  S:H  $ r-  )r>   rˆ   r-   s    r   Úis_first_colÚSubplotSpec.is_first_col‚  r0  r   c                 ód   • U R                   R                  U R                  5       R                  :H  $ r,   )r>   r‰   rx   r   r-   s    r   Úis_last_colÚSubplotSpec.is_last_col…  r4  r   c                 óŒ  • U R                  5       nUR                  5       u  p4[        R                  " U R                  U R
                  /X445      u  pVUR                  U5      u  pxpšXu   R                  5       nX…   R                  5       nX–   R                  5       nX¦   R                  5       n[        R                  " XÛXì5      $ )z:
Update the subplot position from ``figure.subplotpars``.
)rx   r4   rX   Úunravel_indexr“   r”   rr   ÚminÚmaxr   Úfrom_extents)r   r8   rÿ   r   r   r  r  ro   rn   rp   rq   Ú
fig_bottomÚfig_topÚfig_leftÚ	fig_rights                  r   rË   ÚSubplotSpec.get_positionˆ  s³   € ð ×$Ñ$Ó&ˆØ×,Ñ,Ó.‰ˆÜ×%Ò% t§y¡y°$·)±)Ð&<¸u¸nÓM‰
ˆà×'Ñ'¨Ó/ñ 	5ˆ˜yð !Ñ&×*Ñ*Ó,ˆ
Ø‘.×$Ñ$Ó&ˆØ‘?×&Ñ&Ó(ˆØÑ$×(Ñ(Ó*ˆ	Ü× Ò  °yÓJÐJr   c                 óh   • U R                  5       n[        US5      (       a  UR                  5       $ U $ )zH
Return the topmost `SubplotSpec` instance associated with the subplot.
ru   )rx   ry   ru   )r   rÿ   s     r   ru   Ú#SubplotSpec.get_topmost_subplotspec˜  s4   € ð ×$Ñ$Ó&ˆÜ�8Ð6×7Ñ7Ø×3Ñ3Ó5Ð5àˆKr   c           	      óÆ   • U R                   U R                  U R                  4[        US[	        5       5      [        US[	        5       5      [        US[	        5       5      4:H  $ )ze
Two SubplotSpecs are considered equal if they refer to the same
position(s) in the same `GridSpec`.
rþ   r“   r”   )rþ   r“   r”   rÙ   r¦   )r   Úothers     r   Ú__eq__ÚSubplotSpec.__eq__¢  sS   € ð —‘ §¡¨D¯I©IÐ6Ü˜E ;´³Ó9Ü˜E 6¬6«8Ó4Ü˜E 6¬6«8Ó4ð6ñ6ð 	7r   c                 óZ   • [        U R                  U R                  U R                  45      $ r,   )Úhashrþ   r“   r”   r-   s    r   Ú__hash__ÚSubplotSpec.__hash__­  s    € Ü�T—^‘^ T§Y¡Y°·	±	Ð:Ó;Ð;r   c                 ó   • [        XU 40 UD6$ )aá  
Create a GridSpec within this subplot.

The created `.GridSpecFromSubplotSpec` will have this `SubplotSpec` as
a parent.

Parameters
----------
nrows : int
    Number of rows in grid.

ncols : int
    Number of columns in grid.

Returns
-------
`.GridSpecFromSubplotSpec`

Other Parameters
----------------
**kwargs
    All other parameters are passed to `.GridSpecFromSubplotSpec`.

See Also
--------
matplotlib.pyplot.subplots

Examples
--------
Adding three subplots in the space occupied by a single subplot::

    fig = plt.figure()
    gs0 = fig.add_gridspec(3, 1)
    ax1 = fig.add_subplot(gs0[0])
    ax2 = fig.add_subplot(gs0[1])
    gssub = gs0[2].subgridspec(1, 3)
    for i in range(3):
        fig.add_subplot(gssub[0, i])
)rî   )r   r   r   rÌ   s       r   ÚsubgridspecÚSubplotSpec.subgridspec°  s   € ôP ' u°TÑD¸VÑDÐDr   )rþ   r  r“   r”   r,   )r&   r°   r±   r²   r³   r   r)   rµ   r  r´   r”   Úsetterrx   r4   r=   r>   r.  r2  r6  r9  rË   ru   rI  rM  rP  r¶   r7   r   r   r�   r�   	  sµ   † ñô&ò
>ð
 ñ*ó ð*ð^ ñ?ó ð?ð 
‡[�[ñó ðòò	0ð ñAó ðAð
 ñ!ó ð!ò'ò>ò'ò>òKò ò	7ò<õ(Er   r�   c                   ó4   • \ rS rSrSr  SS jr  SS jrSrg)r×   iÛ  zE
Parameters defining the positioning of a subplots grid in a figure.
Nc                 ó|   • S H#  n[        X[        R                  SU 3   5        M%     U R                  XX4XV5        g)aÅ  
Defaults are given by :rc:`figure.subplot.[name]`.

Parameters
----------
left : float
    The position of the left edge of the subplots,
    as a fraction of the figure width.
right : float
    The position of the right edge of the subplots,
    as a fraction of the figure width.
bottom : float
    The position of the bottom edge of the subplots,
    as a fraction of the figure height.
top : float
    The position of the top edge of the subplots,
    as a fraction of the figure height.
wspace : float
    The width of the padding between subplots,
    as a fraction of the average Axes width.
hspace : float
    The height of the padding between subplots,
    as a fraction of the average Axes height.
r¼   rÔ   N)rÁ   rÕ   rÖ   rÑ   )r   rQ   rS   rR   rT   rU   rV   r„   s           r   r   ÚSubplotParams.__init__à  s:   € ó4 JˆCÜ�DœsŸ|™|¨o¸c¸UÐ,CÑDÖEñ Jà�‰�D %¨fÕ=r   c                 ó.  • Ub  UOU R                   Ub  UOU R                  :¼  a  [        S5      eUb  UOU R                  Ub  UOU R                  :¼  a  [        S5      eUb  Xl         Ub  X0l        Ub  X l        Ub  X@l        Ub  XPl        Ub  X`l        gg)zI
Update the dimensions of the passed parameters. *None* means unchanged.
Nzleft cannot be >= rightzbottom cannot be >= top)rQ   rR   r   rS   rT   rU   rV   )r   rQ   rS   rR   rT   rU   rV   s          r   rÑ   ÚSubplotParams.updateþ  s¤   € ð
 Ñ%‰T¨4¯9©9Ø"Ñ.‘E°D·J±Jó@äÐ6Ó7Ð7ØÑ)‰V¨t¯{©{Ø™?‘C°·±ó:äÐ6Ó7Ð7ØÑØŒIØÑØŒJØÑØ ŒKØ‰?ØŒHØÑØ ŒKØÑØ �Kð r   )rS   rV   rQ   rR   rT   rU   )NNNNNN)r&   r°   r±   r²   r³   r   rÑ   r¶   r7   r   r   r×   r×   Û  s$   † ñð @DØ%)ô>ð< >BØ#'÷!r   r×   )r³   r¤   ÚloggingÚnumbersr   ÚnumpyrX   Ú
matplotlibrÕ   r   r   r   Úmatplotlib.transformsr   Ú	getLoggerr&   Ú_logr	   rz   rî   r�   r×   r7   r   r   Ú<module>r_     sv   ðñ
ó Û Ý ã ã ß :Ñ :Ý &à×Ò˜Ó"€÷Rñ Rôj["ˆ|ô ["ô|9<˜lô 9<÷xOEñ OE÷d9!ò 9!r   