§
    p¬¸jo.  ã                   ó´   — d dl Z d dlZd dlmZmZmZ d dlmZ	 d dl
mZmZ d dlmZ d dlmZ  G d„ de¦  «        ZdZej                             e¬	¦  «         dS )
é    N)Ú_apiÚ
_docstringÚ
transforms)Ú	_AxesBaseÚ_TransformedBoundsLocator)ÚAxis)Ú	Transformc                   óª   ‡ — e Zd ZdZdˆ fd„	Zd„ Zd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.
    Nc                 óÊ  •— t          j        ddg|¬¦  «         || _        || _        || _        d| _        | j                             d¬¦  «        }| j        dk    r< t          ¦   «         j        |g d¢fi |¤Ž | j	        | _
        ddg| _        d	d
g| _        n; t          ¦   «         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)Úroot)r   ç      ð?é   ç-Cëâ6?ÚtopÚbottomÚleftÚright)r   r   r   r   NÚnoneTg      à?éÿÿÿÿr   )r   Úcheck_in_listÚ
_functionsÚ_parentÚ_orientationÚ
_ticks_setÚ
get_figureÚsuperÚ__init__Ú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Ú	transformÚkwargsÚfigÚ	otheraxisÚ	__class__s
            €úo/root/private/project/pallet_detection_v2/.venv/lib/python3.11/site-packages/matplotlib/axes/_secondary_axes.pyr!   zSecondaryAxis.__init__   sû  ø€ õ 	Ô˜C ˜:°;Ð?Ñ?Ô?Ð?Ø#ˆŒØˆŒØ'ˆÔØˆŒàŒl×%Ò%¨5Ð%Ñ1Ô1ˆØÔ Ò#Ð#Ø�E‰GŒGÔ˜SÐ"4Ð"4Ð"4Ð?Ð?¸Ð?Ð?Ð?ØœˆDŒJØ % xÐ0ˆDÔØ"(¨'Ð!2ˆDÔÐà�E‰GŒGÔ˜SÐ"4Ð"4Ð"4Ð?Ð?¸Ð?Ð?Ð?ØœˆDŒJØ '¨Ð0ˆDÔØ"'¨Ð!2ˆDÔØ ˆÔð 	×Ò˜( IÑ.Ô.Ð.Ø×Ò˜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)r2   r>   s     r;   r1   zSecondaryAxis.set_alignment<   s¾   € õ 	Ô˜4Ô+°5Ð9Ñ9Ô9Ð9Ø�DÔ$ QÔ'Ò'Ð'Ø#Ô/°°°"°Ô5ˆDÔØŒ�DÔ$ QÔ'Ô(×4Ò4°TÑ:Ô:Ð:ØŒ�DÔ$ QÔ'Ô(×4Ò4°UÑ;Ô;Ð;ØŒ
×%Ò% eÑ,Ô,Ð,ØŒ
×%Ò% eÑ,Ô,Ð,Ð,Ð,r<   c                 óž  — t          j        t          j        df|¬¦  «         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}|�t          j        | j        j        |¦  «        }n,| j        ddd
g}|�t          j        || j        j        ¦  «        }|€| j        j        }|                      t%          ||¦  «        ¦  «         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).

        transform : `.Transform`, optional
            Transform for the location to use. Defaults to
            the parent's ``transAxes``, so locations are normally relative to
            the parent axes.

            .. versionadded:: 3.9
        N)r6   )r4   )r   r   r   g        zlocation must be r   z, r   z, or a float, not r   g»½×Ùß|Û=)r   Úcheck_isinstancer   r	   Ú
isinstanceÚstrr   r$   r0   ÚnumbersÚRealÚ
ValueErrorÚ_locr   Úblended_transform_factoryr   Ú	transAxesÚset_axes_locatorr   )r2   r4   r6   Úboundss       r;   r(   zSecondaryAxis.set_locationO   s˜  € õ, 	Ô�zÔ3°TÐ:ÀiÐPÑPÔPÐPõ �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ð
 Ð$Ý&Ô@Ø”LÔ*¨Iñ7ô 7�	øð ”i  E¨1Ð-ˆFØÐ$Ý&Ô@Ø˜tœ|Ô5ñ7ô 7�	ð ÐØœÔ.ˆIð 	×ÒÕ7¸À	ÑJÔJÑKÔKÐKÐKÐKr<   c                 ór   •— |                       ¦   «          t          ¦   «                              |¦  «         d S ©N)Ú	_set_limsr    Úapply_aspect)r2   Úpositionr:   s     €r;   rO   zSecondaryAxis.apply_aspect�   s1   ø€ à�ŠÑÔÐÝ‰Œ×Ò˜XÑ&Ô&Ð&Ð&Ð&r<   F)Úminorc                óN   —  | j         j        ||fd|i|¤Ž}d| _        d| _        |S )NrQ   T)r#   Ú	set_ticksÚstaler   )r2   ÚticksÚlabelsrQ   r7   Úrets         r;   rS   zSecondaryAxis.set_ticks”   s8   € à"ˆdŒjÔ" 5¨&ÐHÐH¸ÐHÀÐHÐHˆØˆŒ
ØˆŒØˆ
r<   c                 ól  ‡— t          ‰t          ¦  «        rEt          ‰¦  «        dk    r2t          ‰d         ¦  «        rt          ‰d         ¦  «        r‰| _        nDt          ‰t
          ¦  «        r‰j        ˆfd„f| _        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   c                 óR   •— ‰                      ¦   «                              | ¦  «        S rM   )Úinvertedr6   )r   r5   s    €r;   ú<lambda>z-SecondaryAxis.set_functions.<locals>.<lambda>µ   s!   ø€ ˜9×-Ò-Ñ/Ô/×9Ò9¸!Ñ<Ô<€ r<   Nc                 ó   — | S rM   © ©r   s    r;   r\   z-SecondaryAxis.set_functions.<locals>.<lambda>¸   s   € ¨€ r<   c                 ó   — | S rM   r^   r_   s    r;   r\   z-SecondaryAxis.set_functions.<locals>.<lambda>¸   s   € °a€ r<   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)	rB   ÚtupleÚlenÚcallabler   r	   r6   rF   Ú
_set_scale)r2   r5   s    `r;   r)   zSecondaryAxis.set_functions›   sÚ   ø€ õ$ �y¥%Ñ(Ô(ð 	A­S°©^¬^¸qÒ-@Ð-@Ý˜ 1œÑ&Ô&ð .AÝ+3°I¸a´LÑ+AÔ+Að .Að (ˆDŒOˆOÝ˜	¥9Ñ-Ô-ð 	AàÔ$Ø<Ð<Ð<Ð<ðˆDŒOˆOð ÐØ*˜{¨K¨KÐ8ˆDŒOˆOåð @ñ Aô Að Að 	�ŠÑÔÐÐÐr<   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)rN   rd   r    Údraw)r2   Úrendererr:   s     €r;   rf   zSecondaryAxis.drawÀ   sA   ø€ ð 	�ŠÑÔÐà�ŠÑÔÐÝ‰Œ�Š�XÑÔÐÐÐr<   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   )r5   )r   r   r"   Ú	get_scaleÚ
set_xscaler&   Ú
set_yscaler'   r   r#   Úget_ticklocsr   r*   r+   ÚFixedLocator)r2   ÚpscaleÚ	set_scalerU   s       r;   rd   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ð #ˆÔÐÐr<   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)r2   ÚlimsÚset_limÚorderÚneworders        r;   rN   zSecondaryAxis._set_limsë   sµ   € ð
 Ô Ò#Ð#Ø”<×(Ò(Ñ*Ô*ˆDØ”mˆGˆGà”<×(Ò(Ñ*Ô*ˆDØ”mˆGØ�Q”˜$˜qœ'Ò!ˆØ!ˆtŒ˜qÔ!¥"¤(¨4¡.¤.Ñ1Ô1ˆØ˜”7˜T !œWÒ$ˆØ�uÒÐà˜˜˜"˜”:ˆDØˆ�‰Œˆˆˆr<   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)r2   Úargsr7   s      r;   Ú
set_aspectzSecondaryAxis.set_aspectþ   s   € õ
 	ÔÐFÑGÔGÐGÐGÐGr<   c                 óþ   — | j         | j                 }|                     |¬¦  «         | j                             ¦   «         D ] }|j        |u r|                     |¦  «         Œ!|j                             |¦  «         dS )z”
        Change the color of the secondary Axes and all decorators.

        Parameters
        ----------
        color : :mpltype:`color`
        )ÚcolorsN)Ú	_axis_mapr   Úset_tick_paramsr.   ÚvaluesÚaxisÚ	set_colorÚlabel)r2   Úcolorr‡   Úspines       r;   rˆ   zSecondaryAxis.set_color  sƒ   € ð Œ~˜dÔ/Ô0ˆØ×Ò EÐÑ*Ô*Ð*Ø”[×'Ò'Ñ)Ô)ð 	'ð 	'ˆEØŒz˜TÐ!Ð!Ø—’ Ñ&Ô&Ð&øØŒ
×Ò˜UÑ#Ô#Ð#Ð#Ð#r<   rM   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r!   r1   r(   rO   r   Úcopyr   rS   r)   rf   rd   rN   r�   rˆ   Ú__classcell__)r:   s   @r;   r   r      s1  ø€ € € € € ðð ð)0ð )0ð )0ð )0ð )0ð )0ðV-ð -ð -ð&>Lð >Lð >Lð >Lð@'ð 'ð 'ð 'ð 'ð 'ð
 €Z„_�T”^Ñ$Ô$ð°Uð ð ð ð ñ %Ô$ðð#ð #ð #ðJð ð ð ð ð#ð #ð #ð:ð ð ð&Hð Hð Hð$ð $ð $ð $ð $ð $ð $r<   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.

transform : `.Transform`, optional
    If specified, *location* will be
    placed relative to this transform (in the direction of the axis)
    rather than the parent's axis. i.e. a secondary x-axis will
    use the provided y transform and the x transform of the parent.

    .. versionadded:: 3.9

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

Other Parameters
----------------
**kwargs : `~matplotlib.axes.Axes` properties.
    Other miscellaneous Axes parameters.
)Ú_secax_docstring)rD   Únumpyrx   Ú
matplotlibr   r   r   Úmatplotlib.tickerÚtickerr+   Úmatplotlib.axes._baser   r   Úmatplotlib.axisr   Úmatplotlib.transformsr	   r   r’   ÚinterpdÚregisterr^   r<   r;   ú<module>rœ      så   ðØ €€€à Ð Ð Ð à 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø #Ð #Ð #Ð #Ð #Ð #Ø FÐ FÐ FÐ FÐ FÐ FÐ FÐ FØ  Ð  Ð  Ð  Ð  Ð  Ø +Ð +Ð +Ð +Ð +Ð +ðF$ð F$ð F$ð F$ð F$�Iñ F$ô F$ð F$ðR,Ð ðZ Ô × Ò Ð-=Ð Ñ >Ô >Ð >Ð >Ð >r<   