§
    ‡ÛgÉX  ã                   ó  — d Z ddlZddlZddlmZ ddlmZ ddlm	Z
 ddlmZ  G d„ d¦  «        Z G d	„ d
¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Zd„ Z G d„ de¦  «        Z G d„ de¦  «        Zd„ Z	 dd„ZdS )zJ
Helper classes to adjust the positions of multiple axes at drawing time.
é    N)Ú_api)ÚSubplotSpecé   )Ú	axes_sizec                   óÂ   — e Zd ZdZ	 dd„Zd„ Zd„ Zd„ Zd„ Zd	„ Z	d
„ Z
d„ Zd„ Zd„ Zd„ Zdd„Zd„ Zd„ Zd„ Zd„ Zed„ ¦   «         Zed„ ¦   «         Zdd„Zdd„Zd„ Zd d„ZdS )!ÚDivideraQ  
    An Axes positioning class.

    The divider is initialized with lists of horizontal and vertical sizes
    (:mod:`mpl_toolkits.axes_grid1.axes_size`) based on which a given
    rectangular area will be divided.

    The `new_locator` method then creates a callable object
    that can be used as the *axes_locator* of the axes.
    NÚCc                 ó®   — || _         || _        || _        || _        || _        |                      |¦  «         || _        d| _        d| _        d| _	        dS )aË  
        Parameters
        ----------
        fig : Figure
        pos : tuple of 4 floats
            Position of the rectangle that will be divided.
        horizontal : list of :mod:`~mpl_toolkits.axes_grid1.axes_size`
            Sizes for horizontal division.
        vertical : list of :mod:`~mpl_toolkits.axes_grid1.axes_size`
            Sizes for vertical division.
        aspect : bool
            Whether overall rectangular area is reduced so that the relative
            part of the horizontal and vertical scales have the same scale.
        anchor : (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W'}
            Placement of the reduced rectangle, when *aspect* is True.
        r   N)
Ú_figÚ_posÚ_horizontalÚ	_verticalÚ_anchorÚ
set_anchorÚ_aspectÚ
_xrefindexÚ
_yrefindexÚ_locator)ÚselfÚfigÚposÚ
horizontalÚverticalÚaspectÚanchors          úZ/granary/edev/quantum/lib/python3.11/site-packages/mpl_toolkits/axes_grid1/axes_divider.pyÚ__init__zDivider.__init__   sZ   € ð( ˆŒ	ØˆŒ	Ø%ˆÔØ!ˆŒØˆŒØ�Š˜ÑÔÐØˆŒØˆŒØˆŒØˆŒˆˆó    c                 óh   ‡— t          j        ˆfd„|                      ¦   «         D ¦   «         ¦  «        S )Nc                 ó:   •— g | ]}|                      ‰¦  «        ‘ŒS © ©Úget_size©Ú.0ÚsÚrenderers     €r   ú
<listcomp>z0Divider.get_horizontal_sizes.<locals>.<listcomp>:   s%   ø€ ÐMÐMÐM°!˜Ÿš HÑ-Ô-ÐMÐMÐMr   )ÚnpÚarrayÚget_horizontal©r   r'   s    `r   Úget_horizontal_sizeszDivider.get_horizontal_sizes9   s4   ø€ ÝŒxÐMÐMÐMÐM°t×7JÒ7JÑ7LÔ7LÐMÑMÔMÑNÔNÐNr   c                 óh   ‡— t          j        ˆfd„|                      ¦   «         D ¦   «         ¦  «        S )Nc                 ó:   •— g | ]}|                      ‰¦  «        ‘ŒS r!   r"   r$   s     €r   r(   z.Divider.get_vertical_sizes.<locals>.<listcomp>=   s%   ø€ ÐKÐKÐK°!˜Ÿš HÑ-Ô-ÐKÐKÐKr   )r)   r*   Úget_verticalr,   s    `r   Úget_vertical_sizeszDivider.get_vertical_sizes<   s4   ø€ ÝŒxÐKÐKÐKÐK°t×7HÒ7HÑ7JÔ7JÐKÑKÔKÑLÔLÐLr   c                 ó   — || _         dS )z¶
        Set the position of the rectangle.

        Parameters
        ----------
        pos : tuple of 4 floats
            position of the rectangle that will be divided
        N©r   )r   r   s     r   Úset_positionzDivider.set_position?   s   € ð ˆŒ	ˆ	ˆ	r   c                 ó   — | j         S )z%Return the position of the rectangle.r3   ©r   s    r   Úget_positionzDivider.get_positionJ   s
   € àŒyÐr   c                 ó  — t          |t          ¦  «        r&t          j        t          j        j        |¬¦  «         n>t          |t          t          f¦  «        rt          |¦  «        dk    rt          d¦  «        ‚|| _        dS )a�  
        Parameters
        ----------
        anchor : (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W'}
            Either an (*x*, *y*) pair of relative coordinates (0 is left or
            bottom, 1 is right or top), 'C' (center), or a cardinal direction
            ('SW', southwest, is bottom left, etc.).

        See Also
        --------
        .Axes.set_anchor
        )r   é   zanchor must be str or 2-tupleN)Ú
isinstanceÚstrr   Úcheck_in_listÚmtransformsÚBboxÚcoefsÚtupleÚlistÚlenÚ	TypeErrorr   )r   r   s     r   r   zDivider.set_anchorN   su   € õ �f�cÑ"Ô"ð 	=ÝÔ�{Ô/Ô5¸fÐEÑEÔEÐEÐEÝ˜F¥U­D MÑ2Ô2ð 	=µc¸&±k´kÀQÒ6FÐ6FÝÐ;Ñ<Ô<Ð<ØˆŒˆˆr   c                 ó   — | j         S )zReturn the anchor.)r   r6   s    r   Ú
get_anchorzDivider.get_anchorb   ó
   € àŒ|Ðr   c                 ó   — || _         dS )z—
        Parameters
        ----------
        h : list of :mod:`~mpl_toolkits.axes_grid1.axes_size`
            sizes for horizontal division
        N©r   )r   Úhs     r   Úset_horizontalzDivider.set_horizontalf   s   € ð ˆÔÐÐr   c                 ó   — | j         S )zReturn horizontal sizes.rH   r6   s    r   r+   zDivider.get_horizontalo   s   € àÔÐr   c                 ó   — || _         dS )z•
        Parameters
        ----------
        v : list of :mod:`~mpl_toolkits.axes_grid1.axes_size`
            sizes for vertical division
        N©r   )r   Úvs     r   Úset_verticalzDivider.set_verticals   s   € ð ˆŒˆˆr   c                 ó   — | j         S )zReturn vertical sizes.rM   r6   s    r   r0   zDivider.get_vertical|   s
   € àŒ~Ðr   Fc                 ó   — || _         dS )zE
        Parameters
        ----------
        aspect : bool
        N©r   ©r   r   s     r   Ú
set_aspectzDivider.set_aspect€   s   € ð ˆŒˆˆr   c                 ó   — | j         S )zReturn aspect.rR   r6   s    r   Ú
get_aspectzDivider.get_aspectˆ   rF   r   c                 ó   — || _         d S ©N©r   )r   r   s     r   Úset_locatorzDivider.set_locatorŒ   s   € Ø ˆŒˆˆr   c                 ó   — | j         S rX   rY   r6   s    r   Úget_locatorzDivider.get_locator�   s
   € ØŒ}Ðr   c                 ón   — | j         €|                      ¦   «         S |                       ||¦  «        j        S rX   )r   r7   Úbounds)r   Úaxr'   s      r   Úget_position_runtimezDivider.get_position_runtime’   s3   € ØŒ=Ð Ø×$Ò$Ñ&Ô&Ð&à—=’=  XÑ.Ô.Ô5Ð5r   c                 óJ   — |                       d¦  «        \  }}|r||z
  |z  ndS )Nr   )Úsum)ÚsizesÚtotalÚrel_sumÚabs_sums       r   Ú_calc_kzDivider._calc_k˜   s1   € ð !Ÿ9š9 Q™<œ<Ñˆ�Ø.5Ð<�˜‘ 7Ñ*Ð*¸1Ð<r   c                 ó:   — t          j        dg| |dgz  ¢¦  «        S )Nr   r   )r)   Úcumsum)rc   Úks     r   Ú_calc_offsetszDivider._calc_offsetsŸ   s$   € õ Œy˜!Ð/˜u¨¨1 v™~Ð/Ñ0Ô0Ð0r   c                 óH  — | j         j        j        | j         j        z  \  }}|                      ||¦  «        \  }	}
}}|                      |¦  «        }|                      |¦  «        }|                      |||z  ¦  «        }|                      |||z  ¦  «        }|                      ¦   «         rÙt          ||¦  «        }|  
                    ||¦  «        }|  
                    ||¦  «        }|d         |d         z
  |z  }|d         |d         z
  |z  }t          j                             |	|
||¦  «        }t          j                             |	|
||¦  «        }|                     |                      ¦   «         |¦  «        j        \  }}n0|  
                    ||¦  «        }|  
                    ||¦  «        }|	|
}}|€d}|€d}|||         |z  z   ||         ||         z
  |z  }}|||         |z  z   ||         ||         z
  |z  }}t          j                             ||||¦  «        S )aÃ  
        Parameters
        ----------
        nx, nx1 : int
            Integers specifying the column-position of the cell. When *nx1* is
            None, a single *nx*-th column is specified. Otherwise, the
            location of columns spanning between *nx* to *nx1* (but excluding
            *nx1*-th column) is specified.
        ny, ny1 : int
            Same as *nx* and *nx1*, but for row positions.
        axes
        renderer
        éÿÿÿÿr   )r   ÚbboxÚsizeÚdpir`   r-   r1   rg   rV   Úminrk   r=   r>   Úfrom_boundsÚanchoredrE   Úp0)r   ÚnxÚnyÚnx1Úny1Úaxesr'   Úfig_wÚfig_hÚxÚyÚwrI   ÚhsizesÚvsizesÚk_hÚk_vrj   ÚoxÚoyÚwwÚhhÚpbÚpb1Úx0Úy0Úx1Úw1Úy1Úh1s                                 r   ÚlocatezDivider.locate¥   s  € ð ”y”~Ô*¨T¬Y¬]Ñ:‰ˆˆuØ×.Ò.¨t°XÑ>Ô>‰
ˆˆ1ˆa�à×*Ò*¨8Ñ4Ô4ˆØ×(Ò(¨Ñ2Ô2ˆØ�lŠl˜6 5¨1¡9Ñ-Ô-ˆØ�lŠl˜6 5¨1¡9Ñ-Ô-ˆà�?Š?ÑÔð 	Ý�C˜‘”ˆAØ×#Ò# F¨AÑ.Ô.ˆBØ×#Ò# F¨AÑ.Ô.ˆBà�R”&˜2˜aœ5‘. EÑ)ˆBØ�R”&˜2˜aœ5‘. EÑ)ˆBÝÔ!×-Ò-¨a°°A°qÑ9Ô9ˆBÝÔ"×.Ò.¨q°!°R¸Ñ<Ô<ˆCØ—\’\ $§/¢/Ñ"3Ô"3°RÑ8Ô8Ô;‰FˆB��ð ×#Ò# F¨CÑ0Ô0ˆBØ×#Ò# F¨CÑ0Ô0ˆBØ˜�ˆBàˆ;ØˆCØˆ;ØˆCà�b˜”f˜u‘nÑ$ r¨#¤w°°B´Ñ'7¸5Ñ&@ˆBˆØ�b˜”f˜u‘nÑ$ r¨#¤w°°B´Ñ'7¸5Ñ&@ˆBˆåÔ×+Ò+¨B°°B¸Ñ;Ô;Ð;r   c                 óD   — t          | |||�|n|dz   |�|n|dz   ¦  «        S )aÞ  
        Return a new `.AxesLocator` for the specified cell.

        Parameters
        ----------
        nx, nx1 : int
            Integers specifying the column-position of the
            cell. When *nx1* is None, a single *nx*-th column is
            specified. Otherwise, location of columns spanning between *nx*
            to *nx1* (but excluding *nx1*-th column) is specified.
        ny, ny1 : int
            Same as *nx* and *nx1*, but for row positions.
        Nr   ©ÚAxesLocator)r   ru   rv   rw   rx   s        r   Únew_locatorzDivider.new_locatorÖ   s;   € õ Ø�"�bØ�?ˆCˆC¨¨Q©Ø�?ˆCˆC¨¨Q©ñ0ô 0ð 	0r   c                 óz  — t          j        g d¢|¬¦  «         |dk    r-| j                             d|¦  «         | xj        dz  c_        d S |dk    r| j                             |¦  «         d S |dk    r-| j                             d|¦  «         | xj        dz  c_        d S | j                             |¦  «         d S )N©ÚleftÚrightÚbottomÚtop©Úpositionr–   r   r   r—   r˜   )r   r<   r   Úinsertr   Úappendr   r   )r   r›   ro   s      r   Úappend_sizezDivider.append_sizeé   sÛ   € ÝÔÐ=Ð=Ð=Ø$,ð	.ñ 	.ô 	.ð 	.à�vÒÐØÔ×#Ò# A tÑ,Ô,Ð,ØˆOŒO˜qÑ ˆOŒOˆOˆOØ˜Ò Ð ØÔ×#Ò# DÑ)Ô)Ð)Ð)Ð)Ø˜Ò!Ð!ØŒN×!Ò! ! TÑ*Ô*Ð*ØˆOŒO˜qÑ ˆOŒOˆOˆOàŒN×!Ò! $Ñ'Ô'Ð'Ð'Ð'r   çš™™™™™¹?c                 ót   — |€g d¢}|D ].}|                       |t          j        ||¦  «        |z   ¦  «         Œ/dS )a1  
        Add auto-adjustable padding around *use_axes* to take their decorations
        (title, labels, ticks, ticklabels) into account during layout.

        Parameters
        ----------
        use_axes : `~matplotlib.axes.Axes` or list of `~matplotlib.axes.Axes`
            The Axes whose decorations are taken into account.
        pad : float, optional
            Additional padding in inches.
        adjust_dirs : list of {"left", "right", "bottom", "top"}, optional
            The sides where padding is added; defaults to all four sides.
        Nr•   )rž   ÚSizeÚ_AxesDecorationsSize)r   Úuse_axesÚpadÚadjust_dirsÚds        r   Úadd_auto_adjustable_areaz Divider.add_auto_adjustable_area÷   s]   € ð ÐØ<Ð<Ð<ˆKØð 	Nð 	NˆAØ×Ò˜Q¥Ô 9¸(ÀAÑ FÔ FÈÑ LÑMÔMÐMÐMð	Nð 	Nr   )Nr	   )F©NNNN©NN)rŸ   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r-   r1   r4   r7   r   rE   rJ   r+   rO   r0   rT   rV   rZ   r\   r`   Ústaticmethodrg   rk   r�   r“   rž   r§   r!   r   r   r   r      s«  € € € € € ð	ð 	ð &)ðð ð ð ð>Oð Oð OðMð Mð Mð	ð 	ð 	ðð ð ðð ð ð(ð ð ðð ð ð ð  ð  ðð ð ðð ð ðð ð ð ðð ð ð!ð !ð !ðð ð ð6ð 6ð 6ð ð=ð =ñ „\ð=ð ð1ð 1ñ „\ð1ð
/<ð /<ð /<ð /<ðb0ð 0ð 0ð 0ð&(ð (ð (ðNð Nð Nð Nð Nð Nr   r   c                   ó&   — e Zd ZdZdd„Zd„ Zd„ ZdS )r’   zc
    A callable object which returns the position and size of a given
    `.AxesDivider` cell.
    Nc                 óæ   — || _         |j        }|j        }||z
  ||z
  c| _        | _        |€t          | j         ¦  «        }|€t          | j         d         ¦  «        }||z
  | _        ||z
  | _        dS )aì  
        Parameters
        ----------
        axes_divider : `~mpl_toolkits.axes_grid1.axes_divider.AxesDivider`
        nx, nx1 : int
            Integers specifying the column-position of the
            cell. When *nx1* is None, a single *nx*-th column is
            specified. Otherwise, location of columns spanning between *nx*
            to *nx1* (but excluding *nx1*-th column) is specified.
        ny, ny1 : int
            Same as *nx* and *nx1*, but for row positions.
        Nr   )Ú_axes_dividerr   r   Ú_nxÚ_nyrB   Ú_nx1Ú_ny1)r   Úaxes_dividerru   rv   rw   rx   r   r   s           r   r   zAxesLocator.__init__  s   € ð *ˆÔà!Ô,ˆ
Ø!Ô,ˆ
à *™_¨b°:©oÐˆŒ�$”(àˆ;Ý�dÔ(Ñ)Ô)ˆCØˆ;Ý�dÔ(¨Ô+Ñ,Ô,ˆCà˜*Ñ$ˆŒ	Ø˜*Ñ$ˆŒ	ˆ	ˆ	r   c                 ó°   — | j         j        }| j         j        }| j                              | j        |z   | j        |z   | j        |z   | j        |z   ||¦  «        S rX   )r±   r   r   r�   r²   r³   r´   rµ   )r   ry   r'   r   r   s        r   Ú__call__zAxesLocator.__call__-  s`   € àÔ'Ô2ˆ
ØÔ'Ô2ˆ
àÔ!×(Ò(¨¬°JÑ)>Ø)-¬°JÑ)>Ø)-¬°ZÑ)?Ø)-¬°ZÑ)?Ø)-Ø)1ñ3ô 3ð 	3r   c                 ó4   — | j                              ¦   «         S rX   )r±   Úget_subplotspecr6   s    r   rº   zAxesLocator.get_subplotspec9  s   € ØÔ!×1Ò1Ñ3Ô3Ð3r   r©   )rª   r«   r¬   r­   r   r¸   rº   r!   r   r   r’   r’     sP   € € € € € ðð ð
%ð %ð %ð %ð8
3ð 
3ð 
3ð4ð 4ð 4ð 4ð 4r   r’   c                   ó@   ‡ — e Zd ZdZdddddœˆ fd„
Zd„ Zd„ Zd„ Zˆ xZS )	ÚSubplotDividerzT
    The Divider class whose rectangle area is specified as a subplot geometry.
    Nr	   ©r   r   r   r   c                óÀ   •— || _         t          ¦   «                              |g d¢|pg |pg ||¬¦  «         |                      t	          j        ||¦  «        ¦  «         dS )a=  
        Parameters
        ----------
        fig : `~matplotlib.figure.Figure`

        *args : tuple (*nrows*, *ncols*, *index*) or int
            The array of subplots in the figure has dimensions ``(nrows,
            ncols)``, and *index* is the index of the subplot being created.
            *index* starts at 1 in the upper left corner and increases to the
            right.

            If *nrows*, *ncols*, and *index* are all single digit numbers, then
            *args* can be passed as a single 3-digit number (e.g. 234 for
            (2, 3, 4)).
        )r   r   r   r   r½   N)ÚfigureÚsuperr   Úset_subplotspecr   Ú_from_subplot_args)r   r   r   r   r   r   ÚargsÚ	__class__s          €r   r   zSubplotDivider.__init__B  sq   ø€ ð" ˆŒÝ‰Œ×Ò˜˜l˜l˜lØ$.Ð$4°"¸x¸~È2Ø &¨vð 	ñ 	7ô 	7ð 	7ð 	×Ò�[Ô;¸CÀÑFÔFÑGÔGÐGÐGÐGr   c                 ód   — |                       ¦   «                              | j        ¦  «        j        S )z%Return the bounds of the subplot box.)rº   r7   r¿   r^   r6   s    r   r7   zSubplotDivider.get_positionY  s'   € à×#Ò#Ñ%Ô%×2Ò2°4´;Ñ?Ô?ÔFÐFr   c                 ó   — | j         S )zGet the SubplotSpec instance.)Ú_subplotspecr6   s    r   rº   zSubplotDivider.get_subplotspec]  s   € àÔ Ð r   c                 ón   — || _         |                      |                     | j        ¦  «        ¦  «         dS )zSet the SubplotSpec instance.N)rÇ   r4   r7   r¿   )r   Úsubplotspecs     r   rÁ   zSubplotDivider.set_subplotspeca  s4   € à'ˆÔØ×Ò˜+×2Ò2°4´;Ñ?Ô?Ñ@Ô@Ð@Ð@Ð@r   )	rª   r«   r¬   r­   r   r7   rº   rÁ   Ú__classcell__©rÄ   s   @r   r¼   r¼   =  s–   ø€ € € € € ðð ð /3¸TØ SðHð Hð Hð Hð Hð Hð Hð.Gð Gð Gð!ð !ð !ðAð Að Að Að Að Að Ar   r¼   c                   óf   ‡ — e Zd ZdZdˆ fd„	Zddœd„Zdd„Zdd„Zdddœd	„Zd
„ Z	d„ Z
d„ Zd„ Zˆ xZS )ÚAxesDividerz0
    Divider based on the preexisting axes.
    Nc                 ó,  •— || _         |€t          j        |¦  «        | _        n|| _        |€t          j        |¦  «        | _        n|| _        t          ¦   «                              |                     ¦   «         d| j        g| j        gdd¬¦  «         dS )zw
        Parameters
        ----------
        axes : :class:`~matplotlib.axes.Axes`
        xref
        yref
        Nr	   )r   r   r   r   r   r   )	Ú_axesr¡   ÚAxesXÚ_xrefÚAxesYÚ_yrefrÀ   r   Ú
get_figure)r   ry   ÚxrefÚyrefrÄ   s       €r   r   zAxesDivider.__init__l  s•   ø€ ð ˆŒ
Øˆ<Ýœ DÑ)Ô)ˆDŒJˆJàˆDŒJØˆ<Ýœ DÑ)Ô)ˆDŒJˆJàˆDŒJå‰Œ×Ò˜TŸ_š_Ñ.Ô.°DØ%)¤Z L¸D¼J¸<Ø $¨Sð 	ñ 	2ô 	2ð 	2ð 	2ð 	2r   )Ú
axes_classc                ó’   — | j         }|€t          |¦  «        } ||                     ¦   «         |                     d¬¦  «        fi |¤ŽS ©NT)Úoriginal)rÏ   ÚtyperÔ   r7   )r   r×   Úkwargsry   s       r   Ú_get_new_axeszAxesDivider._get_new_axes‚  sZ   € ØŒzˆØÐÝ˜d™œˆJØˆz˜$Ÿ/š/Ñ+Ô+¨T×->Ò->ÈÐ->Ñ-MÔ-Mð $ð $Ø"ð$ð $ð 	$r   Fc                 ó  — |€t           j        d         | j        z  }|r}t          |t          j        ¦  «        st	          j        || j        ¬¦  «        }|r,| j                             d|¦  «         | xj	        dz  c_	        n| j         
                    |¦  «         t          |t          j        ¦  «        st	          j        || j        ¬¦  «        }|rH| j                             d|¦  «         | xj	        dz  c_	        |                      d| j        ¬¦  «        }nK| j         
                    |¦  «         |                      t          | j        ¦  «        dz
  | j        ¬¦  «        } | j        di |¤Ž}|                     |¦  «         |S )z³
        Helper method for ``append_axes("left")`` and ``append_axes("right")``.

        See the documentation of `append_axes` for more details.

        :meta private:
        Nzfigure.subplot.wspace©Úfraction_refr   r   ©ru   rv   r!   )ÚmplÚrcParamsrÑ   r:   r¡   Ú_BaseÚfrom_anyr   rœ   r   r�   r“   r   rB   rÝ   Úset_axes_locator©r   ro   r¤   Ú
pack_startrÜ   Úlocatorr_   s          r   Únew_horizontalzAxesDivider.new_horizontal‰  sŽ  € ð ˆ;Ý”,Ð6Ô7¸$¼*ÑDˆCØð 	-Ý˜c¥4¤:Ñ.Ô.ð BÝ”m C°d´jÐAÑAÔA�Øð -ØÔ ×'Ò'¨¨3Ñ/Ô/Ð/Ø�” 1Ñ$�”�àÔ ×'Ò'¨Ñ,Ô,Ð,Ý˜$¥¤
Ñ+Ô+ð 	@Ý”= °D´JÐ?Ñ?Ô?ˆDØð 	BØÔ×#Ò# A tÑ,Ô,Ð,ØˆOŒO˜qÑ ˆOŒOØ×&Ò&¨!°´Ð&Ñ@Ô@ˆGˆGàÔ×#Ò# DÑ)Ô)Ð)Ø×&Ò&Ý�tÔ'Ñ(Ô(¨1Ñ,°´ð 'ñ Bô BˆGàˆTÔÐ)Ð) &Ð)Ð)ˆØ
×Ò˜GÑ$Ô$Ð$Øˆ	r   c                 ó  — |€t           j        d         | j        z  }|r}t          |t          j        ¦  «        st	          j        || j        ¬¦  «        }|r,| j                             d|¦  «         | xj	        dz  c_	        n| j         
                    |¦  «         t          |t          j        ¦  «        st	          j        || j        ¬¦  «        }|rH| j                             d|¦  «         | xj	        dz  c_	        |                      | j        d¬¦  «        }nK| j         
                    |¦  «         |                      | j        t          | j        ¦  «        dz
  ¬¦  «        } | j        di |¤Ž}|                     |¦  «         |S )z³
        Helper method for ``append_axes("top")`` and ``append_axes("bottom")``.

        See the documentation of `append_axes` for more details.

        :meta private:
        Nzfigure.subplot.hspacerß   r   r   rá   r!   )râ   rã   rÓ   r:   r¡   rä   rå   r   rœ   r   r�   r“   r   rB   rÝ   ræ   rç   s          r   Únew_verticalzAxesDivider.new_vertical©  s‰  € ð ˆ;Ý”,Ð6Ô7¸$¼*ÑDˆCØð 	+Ý˜c¥4¤:Ñ.Ô.ð BÝ”m C°d´jÐAÑAÔA�Øð +Ø”×%Ò% a¨Ñ-Ô-Ð-Ø�” 1Ñ$�”�à”×%Ò% cÑ*Ô*Ð*Ý˜$¥¤
Ñ+Ô+ð 	@Ý”= °D´JÐ?Ñ?Ô?ˆDØð 	@ØŒN×!Ò! ! TÑ*Ô*Ð*ØˆOŒO˜qÑ ˆOŒOØ×&Ò&¨$¬/¸aÐ&Ñ@Ô@ˆGˆGàŒN×!Ò! $Ñ'Ô'Ð'Ø×&Ò&Ø”?¥s¨4¬>Ñ':Ô':¸QÑ'>ð 'ñ @ô @ˆGàˆTÔÐ)Ð) &Ð)Ð)ˆØ
×Ò˜GÑ$Ô$Ð$Øˆ	r   c                óÈ   — t          j        | j        df| j        df| j        df| j        dfdœ|¬¦  «        \  }} |||f||dœ|¤Ž}| j                             |¦  «         |S )am  
        Add a new axes on a given side of the main axes.

        Parameters
        ----------
        position : {"left", "right", "bottom", "top"}
            Where the new axes is positioned relative to the main axes.
        size : :mod:`~mpl_toolkits.axes_grid1.axes_size` or float or str
            The axes width or height.  float or str arguments are interpreted
            as ``axes_size.from_any(size, AxesX(<main_axes>))`` for left or
            right axes, and likewise with ``AxesY`` for bottom or top axes.
        pad : :mod:`~mpl_toolkits.axes_grid1.axes_size` or float or str
            Padding between the axes.  float or str arguments are interpreted
            as for *size*.  Defaults to :rc:`figure.subplot.wspace` times the
            main Axes width (left or right axes) or :rc:`figure.subplot.hspace`
            times the main Axes height (bottom or top axes).
        axes_class : subclass type of `~.axes.Axes`, optional
            The type of the new axes.  Defaults to the type of the main axes.
        **kwargs
            All extra keywords arguments are passed to the created axes.
        TFr•   rš   )rè   r×   )r   Úcheck_getitemrê   rì   r   Úadd_axes)	r   r›   ro   r¤   r×   rÜ   Úcreate_axesrè   r_   s	            r   Úappend_axeszAxesDivider.append_axesÉ  sª   € õ. #'Ô"4ØÔ(¨$Ð/ØÔ)¨5Ð1ØÔ(¨$Ð/ØÔ% uÐ-ð	6
ð 6
ð
 ð#ñ #ô #Ñˆ�Zð ˆ[Ø�#ðOØ",¸ðOð OØGMðOð OˆàŒ	×Ò˜2ÑÔÐØˆ	r   c                 ód   — | j         €#| j                             ¦   «         }|dk    rdS dS | j         S )NÚautoFT)r   rÏ   rV   rS   s     r   rV   zAxesDivider.get_aspectë  s:   € ØŒ<ÐØ”Z×*Ò*Ñ,Ô,ˆFØ˜ÒÐØ�uà�tà”<Ðr   c                 ób   — | j         €"| j                             d¬¦  «        }|j        S | j         S rÙ   )r   rÏ   r7   r^   )r   rn   s     r   r7   zAxesDivider.get_positionõ  s2   € ØŒ9ÐØ”:×*Ò*°DÐ*Ñ9Ô9ˆDØ”;Ðà”9Ðr   c                 óP   — | j         €| j                             ¦   «         S | j         S rX   )r   rÏ   rE   r6   s    r   rE   zAxesDivider.get_anchorü  s&   € ØŒ<ÐØ”:×(Ò(Ñ*Ô*Ð*à”<Ðr   c                 ó4   — | j                              ¦   «         S rX   )rÏ   rº   r6   s    r   rº   zAxesDivider.get_subplotspec  s   € ØŒz×)Ò)Ñ+Ô+Ð+r   r©   )NFrX   )rª   r«   r¬   r­   r   rÝ   rê   rì   rñ   rV   r7   rE   rº   rÊ   rË   s   @r   rÍ   rÍ   g  sì   ø€ € € € € ðð ð2ð 2ð 2ð 2ð 2ð 2ð, +/ð $ð $ð $ð $ð $ðð ð ð ð@ð ð ð ð@ À$ð  ð  ð  ð  ð  ðD ð  ð  ðð ð ð ð  ð  ð,ð ,ð ,ð ,ð ,ð ,ð ,r   rÍ   c	                 ó´  — ||z  }	||z  }
t          |¦  «        }|j        \  }}|j        \  }}t          j        g |¢d‘¦  «        }d|d |…df<   ||dd d…f<   g | ¢|	|                     ¦   «         z
  ‘}t          j                             ||¦  «        �^ }}||
k    r|
|z
  |z  }t          j        dg||z  |z   ¢¦  «        }|d         |d         z
  |z  }|d         \  }}|d         |z  |z   |z  }t          j	         
                    | |||¦  «        }t          j	         
                    | |||¦  «        }|                     ||¦  «        j        \  }}||||fS )Nr   rm   )rB   ÚTr)   Údiagrb   ÚlinalgÚsolveri   r=   r>   rr   rs   rt   )r|   r}   r~   rI   Úsummed_widthsÚequal_heightsrz   r{   r   Útotal_widthÚ
max_heightÚnÚeq_relsÚeq_abssÚsm_relsÚsm_abssÚAÚBÚkarrayÚheightrƒ   r…   Úh0_relÚh0_absr†   r‡   rˆ   r‰   rŠ   s                                r   Ú_locater  	  s†  € à˜!‘)€KØ˜‘€Jõ 	ˆMÑÔ€AØ$”Ñ€GˆWØ$”Ñ€GˆWÝ
Œ��'�˜1�ÑÔ€AØ€A€b€q€bˆ"€f�IØ€A€bˆ#ˆ2ˆ#€g�JØ2ˆGˆ8Ð2�k G§K¢K¡M¤MÑ1Ð2€Aõ
 ”i—o’o a¨Ñ+Ô+�O€VˆVØ�
ÒÐØ˜wÑ&¨'Ñ1ˆõ 
Œ�AÐ5˜ 6Ñ)¨GÑ3Ð5Ñ	6Ô	6€BØ
ˆRŒ&�2�a”5‰.˜EÑ	!€BØ" 1Ô%�N€FˆFØ
�Œ)�FÑ
˜VÑ
# uÑ	,€BÝ	Ô	×	%Ò	% a¨¨A¨qÑ	1Ô	1€BÝ
Ô
×
&Ò
& q¨!¨R°Ñ
4Ô
4€CØ�\Š\˜& "Ñ%Ô%Ô(�F€Bˆàˆr�2�rˆ>Ðr   c                   ó"   — e Zd ZdZdd„Zdd„ZdS )ÚHBoxDividerzÆ
    A `.SubplotDivider` for laying out axes horizontally, while ensuring that
    they have equal heights.

    Examples
    --------
    .. plot:: gallery/axes_grid1/demo_axes_hbox_divider.py
    Nc                 ó6   — t          | |d|�|n|dz   d¦  «        S )a�  
        Create a new `.AxesLocator` for the specified cell.

        Parameters
        ----------
        nx, nx1 : int
            Integers specifying the column-position of the
            cell. When *nx1* is None, a single *nx*-th column is
            specified. Otherwise, location of columns spanning between *nx*
            to *nx1* (but excluding *nx1*-th column) is specified.
        r   Nr   r‘   )r   ru   rw   s      r   r“   zHBoxDivider.new_locator4  s&   € õ ˜4  Q¨s¨¨¨ÀBÈÁFÈAÑNÔNÐNr   c                 óÂ  — | j         j        j        | j         j        z  \  }}|                      ||¦  «        \  }	}
}}|                      |¦  «        }|                      |¦  «        }t          |	|
|||||||                      ¦   «         ¦	  «	        \  }}}}|€d}|||         |z  z   ||         ||         z
  |z  }}||}}t          j
                             ||||¦  «        S ©Nrm   )r   rn   ro   rp   r`   r-   r1   r  rE   r=   r>   rr   )r   ru   rv   rw   rx   ry   r'   rz   r{   r|   r}   r~   rI   Ú	summed_wsÚequal_hsr‰   rŠ   rƒ   r†   r‹   rŒ   r�   rŽ   s                          r   r�   zHBoxDivider.locateB  sì   € à”y”~Ô*¨T¬Y¬]Ñ:‰ˆˆuØ×.Ò.¨t°XÑ>Ô>‰
ˆˆ1ˆa�Ø×-Ò-¨hÑ7Ô7ˆ	Ø×*Ò*¨8Ñ4Ô4ˆÝ Øˆq�!�Q˜	 8¨U°E¸4¿?º?Ñ;LÔ;LñNô N‰ˆˆB��Bàˆ;ØˆCØ�b˜”f˜u‘nÑ$ r¨#¤w°°B´Ñ'7¸5Ñ&@ˆBˆØ�RˆBˆÝÔ×+Ò+¨B°°B¸Ñ;Ô;Ð;r   rX   r¨   ©rª   r«   r¬   r­   r“   r�   r!   r   r   r  r  *  sJ   € € € € € ðð ðOð Oð Oð Oð<ð <ð <ð <ð <ð <r   r  c                   ó"   — e Zd ZdZdd„Zdd„ZdS )ÚVBoxDividerzm
    A `.SubplotDivider` for laying out axes vertically, while ensuring that
    they have equal widths.
    Nc                 ó6   — t          | d|d|�|n|dz   ¦  «        S )a�  
        Create a new `.AxesLocator` for the specified cell.

        Parameters
        ----------
        ny, ny1 : int
            Integers specifying the row-position of the
            cell. When *ny1* is None, a single *ny*-th row is
            specified. Otherwise, location of rows spanning between *ny*
            to *ny1* (but excluding *ny1*-th row) is specified.
        r   r   r‘   )r   rv   rx   s      r   r“   zVBoxDivider.new_locatorW  s&   € õ ˜4  B¨°#°/¨3¨3ÀrÈAÁvÑNÔNÐNr   c                 óÂ  — | j         j        j        | j         j        z  \  }}|                      ||¦  «        \  }	}
}}|                      |¦  «        }|                      |¦  «        }t          |
|	|||||||                      ¦   «         ¦	  «	        \  }}}}|€d}||}}|||         |z  z   ||         ||         z
  |z  }}t          j
                             ||||¦  «        S r  )r   rn   ro   rp   r`   r1   r-   r  rE   r=   r>   rr   )r   ru   rv   rw   rx   ry   r'   rz   r{   r|   r}   r~   rI   Ú	summed_hsÚequal_wsrŠ   r‰   r„   r…   r‹   rŒ   r�   rŽ   s                          r   r�   zVBoxDivider.locatee  sì   € à”y”~Ô*¨T¬Y¬]Ñ:‰ˆˆuØ×.Ò.¨t°XÑ>Ô>‰
ˆˆ1ˆa�Ø×+Ò+¨HÑ5Ô5ˆ	Ø×,Ò,¨XÑ6Ô6ˆÝ Øˆq�!�Q˜	 8¨U°E¸4¿?º?Ñ;LÔ;LñNô N‰ˆˆB��Bàˆ;ØˆCØ�RˆBˆØ�b˜”f˜u‘nÑ$ r¨#¤w°°B´Ñ'7¸5Ñ&@ˆBˆÝÔ×+Ò+¨B°°B¸Ñ;Ô;Ð;r   rX   r¨   r  r!   r   r   r  r  Q  sJ   € € € € € ðð ð
Oð Oð Oð Oð<ð <ð <ð <ð <ð <r   r  c                 ó|   — t          | ¦  «        }|                     dd¬¦  «        }|                      |¦  «         |S )Nr   rá   )rÍ   r“   ræ   )ry   Údividerré   s      r   Úmake_axes_locatabler  t  s@   € Ý˜$ÑÔ€GØ×!Ò! Q¨1Ð!Ñ-Ô-€GØ×Ò˜'Ñ"Ô"Ð"à€Nr   rŸ   c                 óh   — |€g d¢}t          | ¦  «        }|€| }|                     |||¬¦  «         dS )aG  
    Add auto-adjustable padding around *ax* to take its decorations (title,
    labels, ticks, ticklabels) into account during layout, using
    `.Divider.add_auto_adjustable_area`.

    By default, padding is determined from the decorations of *ax*.
    Pass *use_axes* to consider the decorations of other Axes instead.
    Nr•   )r£   r¤   r¥   )r  r§   )r_   r£   r¤   r¥   r  s        r   Úmake_axes_area_auto_adjustabler  |  s[   € ð ÐØ8Ð8Ð8ˆÝ! "Ñ%Ô%€GØÐØˆØ×$Ò$¨h¸CØ1<ð %ñ >ô >ð >ð >ð >r   )NrŸ   N)r­   Únumpyr)   Ú
matplotlibrâ   r   Úmatplotlib.gridspecr   Úmatplotlib.transformsÚ
transformsr=   Ú r   r¡   r   r’   r¼   rÍ   r  r  r  r  r  r!   r   r   ú<module>r%     sÑ  ððð ð Ð Ð Ð à Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø +Ð +Ð +Ð +Ð +Ð +Ø +Ð +Ð +Ð +Ð +Ð +Ø Ð Ð Ð Ð Ð ðzNð zNð zNð zNð zNñ zNô zNð zNðz/4ð /4ð /4ð /4ð /4ñ /4ô /4ð /4ðd'Að 'Að 'Að 'Að 'A�Wñ 'Aô 'Að 'AðT\,ð \,ð \,ð \,ð \,�'ñ \,ô \,ð \,ðDð ð ðB$<ð $<ð $<ð $<ð $<�.ñ $<ô $<ð $<ðN <ð  <ð  <ð  <ð  <�.ñ  <ô  <ð  <ðFð ð ð 15ð>ð >ð >ð >ð >ð >r   