§
    ‡ÛgÜ(  ã                   ó¤   — d dl Z d dlZd dlmZmZ d dlmZ d dl	m
Z
mZ d dlmZ  G d„ de
¦  «        ZdZej                             e¬¦  «         dS )	é    N)Ú_apiÚ
_docstring)Ú	_AxesBaseÚ_TransformedBoundsLocator)ÚAxisc                   ó¦   ‡ — e Zd ZdZˆ fd„Zd„ Zd„ Zdˆ fd„	Z ej	        e
j        ¦  «        dddœd	„¦   «         Zd
„ Zˆ fd„Zd„ Zd„ Zd„ Zd„ Zˆ xZS )ÚSecondaryAxisz4
    General class to hold a Secondary_X/Yaxis.
    c                 óº  •— t          j        ddg|¬¦  «         || _        || _        || _        d| _        | j        dk    rF t          ¦   «         j        | j        j        g d¢fi |¤Ž | j	        | _
        ddg| _        dd	g| _        nE t          ¦   «         j        | j        j        g d
¢fi |¤Ž | j        | _
        d	dg| _        ddg| _        d| _        |                      |¦  «         |                      |¦  «         | j        dk    r| j        n| j	        }|                     t%          j        ¦   «         ¦  «         |                     d¦  «         | j        | j                                      d¦  «         | j        | j                                      d¦  «         | j        dk     r| j        ddd…         | _        |                      | j        d         ¦  «         dS )zÎ
        See `.secondary_xaxis` and `.secondary_yaxis` for the doc string.
        While there is no need for this to be private, it should really be
        called by those higher level functions.
        ÚxÚy)ÚorientationF)r   ç      ð?é   ç-Cëâ6?ÚtopÚbottomÚleftÚright)r   r   r   r   NÚnoneTg      à?éÿÿÿÿr   )r   Úcheck_in_listÚ
_functionsÚ_parentÚ_orientationÚ
_ticks_setÚsuperÚ__init__ÚfigureÚxaxisÚ_axisÚ_locstringsÚ_otherstringsÚyaxisÚ_parentscaleÚset_locationÚset_functionsÚset_major_locatorÚmtickerÚNullLocatorÚset_ticks_positionÚspinesÚset_visibleÚ_posÚset_alignment)ÚselfÚparentr   ÚlocationÚ	functionsÚkwargsÚ	otheraxisÚ	__class__s          €úU/granary/edev/quantum/lib/python3.11/site-packages/matplotlib/axes/_secondary_axes.pyr   zSecondaryAxis.__init__   së  ø€ õ 	Ô˜C ˜:°;Ð?Ñ?Ô?Ð?Ø#ˆŒØˆŒØ'ˆÔØˆŒàÔ Ò#Ð#Ø�E‰GŒGÔ˜Tœ\Ô0Ð2DÐ2DÐ2DÐOÐOÈÐOÐOÐOØœˆDŒJØ % xÐ0ˆDÔØ"(¨'Ð!2ˆDÔÐà�E‰GŒGÔ˜Tœ\Ô0Ð2DÐ2DÐ2DÐOÐOÈÐOÐOÐOØœˆDŒJØ '¨Ð0ˆDÔØ"'¨Ð!2ˆDÔØ ˆÔð 	×Ò˜(Ñ#Ô#Ð#Ø×Ò˜9Ñ%Ô%Ð%ð #'Ô"3°sÒ":Ð":�D”J�JÀÄ
ˆ	Ø×#Ò#¥GÔ$7Ñ$9Ô$9Ñ:Ô:Ð:Ø×$Ò$ VÑ,Ô,Ð,àŒ�DÔ&Ô'×3Ò3°EÑ:Ô:Ð:ØŒ�DÔ$Ô%×1Ò1°$Ñ7Ô7Ð7àŒ9�sŠ?ˆ?à#Ô/°°°"°Ô5ˆDÔØ×Ò˜4Ô+¨AÔ.Ñ/Ô/Ð/Ð/Ð/ó    c                 óœ  — t          j        | j        |¬¦  «         || j        d         k    r| j        ddd…         | _        | j        | j        d                                       d¦  «         | j        | j        d                                       d¦  «         | j                             |¦  «         | j                             |¦  «         dS )a<  
        Set if axes spine and labels are drawn at top or bottom (or left/right)
        of the axes.

        Parameters
        ----------
        align : {'top', 'bottom', 'left', 'right'}
            Either 'top' or 'bottom' for orientation='x' or
            'left' or 'right' for orientation='y' axis.
        )Úalignr   Nr   r   TF)r   r   r!   r+   r,   r    r*   Úset_label_position)r/   r9   s     r6   r.   zSecondaryAxis.set_alignment9   s¾   € õ 	Ô˜4Ô+°5Ð9Ñ9Ô9Ð9Ø�DÔ$ QÔ'Ò'Ð'Ø#Ô/°°°"°Ô5ˆDÔØŒ�DÔ$ QÔ'Ô(×4Ò4°TÑ:Ô:Ð:ØŒ�DÔ$ QÔ'Ô(×4Ò4°UÑ;Ô;Ð;ØŒ
×%Ò% eÑ,Ô,Ð,ØŒ
×%Ò% eÑ,Ô,Ð,Ð,Ð,r7   c                 óÎ  — t          |t          ¦  «        r)t          j        | j        |¬¦  «         |dv rdnd| _        nPt          |t          j        ¦  «        r|| _        n.t          d| j        d         ›d| j        d         ›d	|›�¦  «        ‚|| _	        | j
        d
k    rd| j        ddg}n| j        dddg}|                      t          || j        j        ¦  «        ¦  «         dS )a+  
        Set the vertical or horizontal location of the axes in
        parent-normalized coordinates.

        Parameters
        ----------
        location : {'top', 'bottom', 'left', 'right'} or float
            The position to put the secondary axis.  Strings can be 'top' or
            'bottom' for orientation='x' and 'right' or 'left' for
            orientation='y'. A float indicates the relative position on the
            parent axes to put the new axes, 0.0 being the bottom (or left)
            and 1.0 being the top (or right).
        )r1   )r   r   r   g        zlocation must be r   z, r   z, or a float, not r   g»½×Ùß|Û=N)Ú
isinstanceÚstrr   r   r!   r-   ÚnumbersÚRealÚ
ValueErrorÚ_locr   Úset_axes_locatorr   r   Ú	transAxes)r/   r1   Úboundss      r6   r%   zSecondaryAxis.set_locationL   s3  € õ  �h¥Ñ$Ô$ð 	JÝÔ˜tÔ/¸(ÐCÑCÔCÐCØ&Ð*:Ð:Ð:˜˜ÀˆDŒIˆIÝ˜¥'¤,Ñ/Ô/ð 	JØ ˆDŒIˆIåðI DÔ$4°QÔ$7ð Ið IØÔ# AÔ&ðIð IØ<DðIð IñJô Jð Jð ˆŒ	àÔ Ò#Ð#ð ˜œ B¨Ð.ˆFˆFà”i  E¨1Ð-ˆFð 	×ÒÝ% f¨d¬lÔ.DÑEÔEñ	Gô 	Gð 	Gð 	Gð 	Gr7   Nc                 ór   •— |                       ¦   «          t          ¦   «                              |¦  «         d S ©N)Ú	_set_limsr   Úapply_aspect)r/   Úpositionr5   s     €r6   rH   zSecondaryAxis.apply_aspectv   s1   ø€ à�ŠÑÔÐÝ‰Œ×Ò˜XÑ&Ô&Ð&Ð&Ð&r7   F)Úminorc                óN   —  | j         j        ||fd|i|¤Ž}d| _        d| _        |S )NrJ   T)r    Ú	set_ticksÚstaler   )r/   ÚticksÚlabelsrJ   r3   Úrets         r6   rL   zSecondaryAxis.set_ticks{   s8   € à"ˆdŒjÔ" 5¨&ÐHÐH¸ÐHÀÐHÐHˆØˆŒ
ØˆŒØˆ
r7   c                 ó  — t          |t          ¦  «        rEt          |¦  «        dk    r2t          |d         ¦  «        rt          |d         ¦  «        r|| _        n|€d„ d„ f| _        nt          d¦  «        ‚|                      ¦   «          dS )a&  
        Set how the secondary axis converts limits from the parent axes.

        Parameters
        ----------
        functions : 2-tuple of func, or `Transform` with an inverse.
            Transform between the parent axis values and the secondary axis
            values.

            If supplied as a 2-tuple of functions, the first function is
            the forward transform function and the second is the inverse
            transform.

            If a transform is supplied, then the transform must have an
            inverse.
        é   r   r   Nc                 ó   — | S rF   © ©r   s    r6   ú<lambda>z-SecondaryAxis.set_functions.<locals>.<lambda>™   s   € ¨€ r7   c                 ó   — | S rF   rT   rU   s    r6   rV   z-SecondaryAxis.set_functions.<locals>.<lambda>™   s   € °a€ r7   z›functions argument of secondary axes must be a two-tuple of callable functions with the first function being the transform and the second being the inverse)r<   ÚtupleÚlenÚcallabler   r@   Ú
_set_scale)r/   r2   s     r6   r&   zSecondaryAxis.set_functions‚   s§   € õ" �y¥%Ñ(Ô(ð 	A­S°©^¬^¸qÒ-@Ð-@Ý˜ 1œÑ&Ô&ð .AÝ+3°I¸a´LÑ+AÔ+Að .Að (ˆDŒOˆOØÐØ*˜{¨K¨KÐ8ˆDŒOˆOåð @ñ Aô Að Að 	�ŠÑÔÐÐÐr7   c                 óš   •— |                       ¦   «          |                      ¦   «          t          ¦   «                              |¦  «         dS )zÿ
        Draw the secondary axes.

        Consults the parent axes for its limits and converts them
        using the converter specified by
        `~.axes._secondary_axes.set_functions` (or *functions*
        parameter when axes initialized.)
        N)rG   r[   r   Údraw)r/   Úrendererr5   s     €r6   r]   zSecondaryAxis.draw¡   sA   ø€ ð 	�ŠÑÔÐà�ŠÑÔÐÝ‰Œ�Š�XÑÔÐÐÐr7   c                 óÆ  — | j         dk    r&| j        j                             ¦   «         }| j        }n%| j        j                             ¦   «         }| j        }|| j        k    rdS | j        r| j	         
                    ¦   «         } ||dk    rdnd| j        ddd…         ¬¦  «         | j        r,| j	                             t          j        |¦  «        ¦  «         || _        dS )z3
        Check if parent has set its scale
        r   NÚlogÚfunctionlogÚfunctionr   )r2   )r   r   r   Ú	get_scaleÚ
set_xscaler#   Ú
set_yscaler$   r   r    Úget_ticklocsr   r'   r(   ÚFixedLocator)r/   ÚpscaleÚ	set_scalerN   s       r6   r[   zSecondaryAxis._set_scale¯   sõ   € ð
 Ô Ò#Ð#Ø”\Ô'×1Ò1Ñ3Ô3ˆFØœˆIˆIà”\Ô'×1Ò1Ñ3Ô3ˆFØœˆIØ�TÔ&Ò&Ð&ØˆFàŒ?ð 	.Ø”J×+Ò+Ñ-Ô-ˆEð 	ˆ	 6¨U¢? ?�-�-¸
Ø œO¨D¨D¨b¨DÔ1ð	3ñ 	3ô 	3ð 	3ð
 Œ?ð 	FØŒJ×(Ò(­Ô)=¸eÑ)DÔ)DÑEÔEÐEð #ˆÔÐÐr7   c                 ón  — | j         dk    r!| j                             ¦   «         }| j        }n | j                             ¦   «         }| j        }|d         |d         k     } | j        d         t          j        |¦  «        ¦  «        }|d         |d         k     }||k    r|ddd…         } ||¦  «         dS )z‚
        Set the limits based on parent limits and the convert method
        between the parent and this secondary axes.
        r   r   r   Nr   )	r   r   Úget_xlimÚset_xlimÚget_ylimÚset_ylimr   ÚnpÚarray)r/   ÚlimsÚset_limÚorderÚneworders        r6   rG   zSecondaryAxis._set_limsÌ   sµ   € ð
 Ô Ò#Ð#Ø”<×(Ò(Ñ*Ô*ˆDØ”mˆGˆGà”<×(Ò(Ñ*Ô*ˆDØ”mˆGØ�Q”˜$˜qœ'Ò!ˆØ!ˆtŒ˜qÔ!¥"¤(¨4¡.¤.Ñ1Ô1ˆØ˜”7˜T !œWÒ$ˆØ�uÒÐà˜˜˜"˜”:ˆDØˆ�‰Œˆˆˆr7   c                 ó.   — t          j        d¦  «         dS )zj
        Secondary axes cannot set the aspect ratio, so calling this just
        sets a warning.
        z)Secondary axes can't set the aspect ratioN)r   Úwarn_external)r/   Úargsr3   s      r6   Ú
set_aspectzSecondaryAxis.set_aspectß   s   € õ
 	ÔÐFÑGÔGÐGÐGÐGr7   c                 óð  — | j         dk    rv|                      d|¬¦  «         | j        j                             |¦  «         | j        j                             |¦  «         | j        j                             |¦  «         dS |                      d|¬¦  «         | j        j                             |¦  «         | j        j	                             |¦  «         | j
        j                             |¦  «         dS )z‰
        Change the color of the secondary axes and all decorators.

        Parameters
        ----------
        color : color
        r   )ÚaxisÚcolorsr   N)r   Útick_paramsr+   r   Ú	set_colorr   r   Úlabelr   r   r#   )r/   Úcolors     r6   r}   zSecondaryAxis.set_coloræ   så   € ð Ô Ò#Ð#Ø×Ò #¨eÐÑ4Ô4Ð4ØŒKÔ×(Ò(¨Ñ/Ô/Ð/ØŒKŒO×%Ò% eÑ,Ô,Ð,ØŒJÔ×&Ò& uÑ-Ô-Ð-Ð-Ð-à×Ò #¨eÐÑ4Ô4Ð4ØŒKÔ×&Ò& uÑ-Ô-Ð-ØŒKÔ×'Ò'¨Ñ.Ô.Ð.ØŒJÔ×&Ò& uÑ-Ô-Ð-Ð-Ð-r7   rF   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r.   r%   rH   r   Úcopyr   rL   r&   r]   r[   rG   rx   r}   Ú__classcell__)r5   s   @r6   r	   r	      s%  ø€ € € € € ðð ð'0ð '0ð '0ð '0ð '0ðR-ð -ð -ð&(Gð (Gð (GðT'ð 'ð 'ð 'ð 'ð 'ð
 €Z„_�T”^Ñ$Ô$ð°Uð ð ð ð ñ %Ô$ððð ð ð>ð ð ð ð ð#ð #ð #ð:ð ð ð&Hð Hð Hð.ð .ð .ð .ð .ð .ð .r7   r	   a¥  
Warnings
--------
This method is experimental as of 3.1, and the API may change.

Parameters
----------
location : {'top', 'bottom', 'left', 'right'} or float
    The position to put the secondary axis.  Strings can be 'top' or
    'bottom' for orientation='x' and 'right' or 'left' for
    orientation='y'. A float indicates the relative position on the
    parent axes to put the new axes, 0.0 being the bottom (or left)
    and 1.0 being the top (or right).

functions : 2-tuple of func, or Transform with an inverse

    If a 2-tuple of functions, the user specifies the transform
    function and its inverse.  i.e.
    ``functions=(lambda x: 2 / x, lambda x: 2 / x)`` would be an
    reciprocal transform with a factor of 2. Both functions must accept
    numpy arrays as input.

    The user can also directly supply a subclass of
    `.transforms.Transform` so long as it has an inverse.

    See :doc:`/gallery/subplots_axes_and_figures/secondary_axis`
    for examples of making these conversions.

Returns
-------
ax : axes._secondary_axes.SecondaryAxis

Other Parameters
----------------
**kwargs : `~matplotlib.axes.Axes` properties.
    Other miscellaneous axes parameters.
)Ú_secax_docstring)r>   Únumpyro   Ú
matplotlibr   r   Úmatplotlib.tickerÚtickerr(   Úmatplotlib.axes._baser   r   Úmatplotlib.axisr   r	   r†   ÚinterpdÚupdaterT   r7   r6   ú<module>r�      sÍ   ðØ €€€à Ð Ð Ð à 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø #Ð #Ð #Ð #Ð #Ð #Ø FÐ FÐ FÐ FÐ FÐ FÐ FÐ FØ  Ð  Ð  Ð  Ð  Ð  ðl.ð l.ð l.ð l.ð l.�Iñ l.ô l.ð l.ð^$Ð ðJ Ô × Ò Ð+;Ð Ñ <Ô <Ð <Ð <Ð <r7   