ó
    [ho.  ã                   ó¨   • S SK r S SKrS SKJrJrJr  S SKJr	  S SK
JrJr  S SKJr  S SKJr   " S S\5      rSr\R&                  R)                  \S	9  g)
é    N)Ú_apiÚ
_docstringÚ
transforms)Ú	_AxesBaseÚ_TransformedBoundsLocator)ÚAxis)Ú	Transformc                   óÊ   ^ • \ rS rSrSrSU 4S jjrS rSS jrSU 4S jjr\	R                  " \R                  5      SSS.S	 jj5       rS
 rU 4S jrS rS rS rS rSrU =r$ )ÚSecondaryAxisé   z,
General class to hold a Secondary_X/Yaxis.
c                 óÌ  >• [         R                  " SS/US9  X@l        Xl        X l        SU l        U R                  R                  SS9nU R                  S:X  a8  [        T	U ]   " U/ SQ40 UD6  U R                  U l
        SS/U l        S	S
/U l        O7[        T	U ]   " U/ SQ40 UD6  U R                  U l
        S
S	/U l        SS/U l        SU l        U R                  X55        U R!                  U5        U R                  S:X  a  U R                  OU R                  nUR#                  [$        R&                  " 5       5        UR)                  S5        U R*                  U R                     R-                  S5        U R*                  U R                     R-                  S5        U R.                  S:  a  U R                  SSS2   U l        U R1                  U R                  S   5        g)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
            €Ún/home/gothic/public_html/Fooocus/fooocus_env/lib64/python3.13/site-packages/matplotlib/axes/_secondary_axes.pyr"   ÚSecondaryAxis.__init__   s§  ø€ ô 	×Ò˜C ˜:°;Ò?Ø#ŒØŒØ'ÔØˆŒà�l‰l×%Ñ%¨5Ð%Ð1ˆØ×Ñ Ó#Ü‰GÒ˜SÒ"4Ñ?¸Ò?ØŸ™ˆDŒJØ % xÐ0ˆDÔØ"(¨'Ð!2ˆDÕä‰GÒ˜SÒ"4Ñ?¸Ò?ØŸ™ˆDŒJØ '¨Ð0ˆDÔØ"'¨Ð!2ˆDÔØ ˆÔð 	×Ñ˜(Ô.Ø×Ñ˜9Ô%ð #'×"3Ñ"3°sÓ":�D—J’JÀÇ
Á
ˆ	Ø×#Ñ#¤G×$7Ò$7Ó$9Ô:Ø×$Ñ$ VÔ,à�‰�D×&Ñ&Ñ'×3Ñ3°EÔ:Ø�‰�D×$Ñ$Ñ%×1Ñ1°$Ô7à�9‰9�s‹?à#×/Ñ/±°"°Ñ5ˆDÔØ×Ñ˜4×+Ñ+¨AÑ.Õ/ó    c                 ó¬  • [         R                  " U R                  US9  XR                  S   :X  a  U R                  SSS2   U l        U R                  U R                  S      R	                  S5        U R                  U R                  S      R	                  S5        U R
                  R                  U5        U R
                  R                  U5        g)zü
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/   r0   r$   r.   Úset_label_position)r3   r@   s     r<   r2   ÚSecondaryAxis.set_alignment<   sª   € ô 	×Ò˜4×+Ñ+°5Ò9Ø×$Ñ$ QÑ'Ó'Ø#×/Ñ/±°"°Ñ5ˆDÔØ�‰�D×$Ñ$ QÑ'Ñ(×4Ñ4°TÔ:Ø�‰�D×$Ñ$ QÑ'Ñ(×4Ñ4°UÔ;Ø�
‰
×%Ñ% eÔ,Ø�
‰
×%Ñ% eÕ,r>   c                 ó  • [         R                  " [        R                  S4US9  [	        U[
        5      (       a/  [         R                  " U R                  US9  US;   a  SOSU l        OW[	        U[        R                  5      (       a  Xl        O1[        SU R                  S   < S	U R                  S
   < SU< 35      eXl        U R                  S:X  a?  SU R                  SS/nUb+  [        R                  " U R                  R                   U5      nO=U R                  SSS
/nUb*  [        R                  " X R                  R                   5      nUc  U R                  R                   nU R#                  [%        X25      5        g)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)r7   )r5   )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%   r1   ÚnumbersÚRealÚ
ValueErrorÚ_locr   Úblended_transform_factoryr   Ú	transAxesÚset_axes_locatorr   )r3   r5   r7   Úboundss       r<   r)   ÚSecondaryAxis.set_locationO   sb  € ô, 	×Òœz×3Ñ3°TÐ:ÀiÒPô �h¤×$Ñ$Ü×Ò˜t×/Ñ/¸(ÒCØ&Ð*:Ó:™ÀˆD�IÜ˜¤'§,¡,×/Ñ/Ø �IäØ# D×$4Ñ$4°QÑ$7Ñ#:¸"Ø×#Ñ# AÑ&Ñ)Ð);¸H¹<ðIóJð Jð Œ	à×Ñ Ó#ð ˜Ÿ™ B¨Ð.ˆFð
 Ñ$Ü&×@Ò@Ø—L‘L×*Ñ*¨Ió7�	øð —i‘i  E¨1Ð-ˆFØÑ$Ü&×@Ò@ØŸ|™|×5Ñ5ó7�	ð ÑØŸ™×.Ñ.ˆIð 	×ÑÔ7¸ÓJÕKr>   c                 óD   >• U R                  5         [        TU ]	  U5        g ©N)Ú	_set_limsr!   Úapply_aspect)r3   Úpositionr;   s     €r<   rS   ÚSecondaryAxis.apply_aspect�   s   ø€ à�‰ÔÜ‰Ñ˜XÕ&r>   F)Úminorc                ó`   • U R                   R                  " X4SU0UD6nSU l        SU l        U$ )NrV   T)r$   Ú	set_ticksÚstaler   )r3   ÚticksÚlabelsrV   r8   Úrets         r<   rX   ÚSecondaryAxis.set_ticks”   s3   € à�j‰j×"Ò" 5ÑH¸ÐHÀÑHˆØˆŒ
ØˆŒØˆ
r>   c                 óX  ^• [        T[        5      (       a=  [        T5      S:X  a.  [        TS   5      (       a  [        TS   5      (       a  TU l        OG[        T[
        5      (       a  TR                  U4S j4U l        OTc  S S 4U l        O[        S5      eU R                  5         g)	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                 óB   >• TR                  5       R                  U 5      $ rQ   )Úinvertedr7   )r   r6   s    €r<   Ú<lambda>Ú-SecondaryAxis.set_functions.<locals>.<lambda>µ   s   ø€ ˜9×-Ñ-Ó/×9Ñ9¸!Ô<r>   Nc                 ó   • U $ rQ   © ©r   s    r<   rb   rc   ¸   s   € ©r>   c                 ó   • U $ rQ   re   rf   s    r<   rb   rc   ¸   s   € ±ar>   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)	rE   ÚtupleÚlenÚcallabler   r	   r7   rI   Ú
_set_scale)r3   r6   s    `r<   r*   ÚSecondaryAxis.set_functions›   sš   ø€ ô$ �y¤%×(Ñ(¬S°«^¸qÓ-@Ü˜ 1™×&Ñ&¬8°I¸a±L×+AÑ+Að (ˆD�OÜ˜	¤9×-Ñ-à×$Ñ$Ü<ðˆD�Oð ÑÙ*©KÐ8ˆD�Oäð @ó Að Að 	�‰Õr>   c                 ód   >• U R                  5         U R                  5         [        TU ]  U5        g)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)rR   rk   r!   Údraw)r3   Úrendererr;   s     €r<   rn   ÚSecondaryAxis.drawÀ   s%   ø€ ð 	�‰Ôà�‰ÔÜ‰‰�XÕr>   c                 ó&  • U R                   S:X  a1  U R                  R                  R                  5       nU R                  nO0U R                  R
                  R                  5       nU R                  nXR                  :X  a  gU R                  (       a  U R                  R                  5       nU" US:X  a  SOSU R                  SSS2   S9  U R                  (       a/  U R                  R                  [        R                  " W5      5        Xl        g)z#
Check if parent has set its scale
r   NÚlogÚfunctionlogÚfunctionr   )r6   )r   r   r#   Ú	get_scaleÚ
set_xscaler'   Ú
set_yscaler(   r   r$   Úget_ticklocsr   r+   r,   ÚFixedLocator)r3   ÚpscaleÚ	set_scalerZ   s       r<   rk   ÚSecondaryAxis._set_scaleÎ   sÎ   € ð
 ×Ñ Ó#Ø—\‘\×'Ñ'×1Ñ1Ó3ˆFØŸ™‰Ià—\‘\×'Ñ'×1Ñ1Ó3ˆFØŸ™ˆIØ×&Ñ&Ó&Øà�?�?Ø—J‘J×+Ñ+Ó-ˆEñ 	 6¨U£?‘-¸
Ø ŸO™O©D¨b¨DÑ1ò	3ð
 �?�?Ø�J‰J×(Ñ(¬×)=Ò)=¸eÓ)DÔEð #Õr>   c                 óf  • U R                   S:X  a'  U R                  R                  5       nU R                  nO&U R                  R	                  5       nU R
                  nUS   US   :  nU R                  S   " [        R                  " U5      5      nUS   US   :  nXC:w  a  USSS2   nU" U5        g)zj
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)r3   ÚlimsÚset_limÚorderÚneworders        r<   rR   ÚSecondaryAxis._set_limsë   s¡   € ð
 ×Ñ Ó#Ø—<‘<×(Ñ(Ó*ˆDØ—m‘m‰Gà—<‘<×(Ñ(Ó*ˆDØ—m‘mˆGØ�Q‘˜$˜q™'Ñ!ˆØ�‰˜qÒ!¤"§(¢(¨4£.Ó1ˆØ˜‘7˜T !™WÑ$ˆØÓà™˜"˜‘:ˆDÙ��r>   c                 ó0   • [         R                  " S5        g)zR
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)r3   Úargsr8   s      r<   Ú
set_aspectÚSecondaryAxis.set_aspectþ   s   € ô
 	×ÒÐFÕGr>   c                 ó  • U R                   U R                     nUR                  US9  U R                  R	                  5        H%  nUR
                  UL d  M  UR                  U5        M'     UR                  R                  U5        g)zl
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)r3   Úcolorr“   Úspines       r<   r”   ÚSecondaryAxis.set_color  sl   € ð �~‰~˜d×/Ñ/Ñ0ˆØ×Ñ EÐÑ*Ø—[‘[×'Ñ'Ö)ˆEØ�z‰z˜TÔ!Ø—‘ Ö&ñ *ð 	�
‰
×Ñ˜UÕ#r>   )r$   r   rJ   r%   r   r&   r   r(   r1   r   rY   rQ   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r"   r2   r)   rS   r   Úcopyr   rX   r*   rn   rk   rR   rŒ   r”   Ú__static_attributes__Ú__classcell__)r;   s   @r<   r   r      sl   ø† ñ÷)0òV-ô&>L÷@'ð
 ‡_‚_�T—^‘^Ó$ð°Uõ ó %ðò#õJò#ò:ò&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)rG   Únumpyr‚   Ú
matplotlibr   r   r   Úmatplotlib.tickerÚtickerr,   Úmatplotlib.axes._baser   r   Úmatplotlib.axisr   Úmatplotlib.transformsr	   r   r¡   ÚinterpdÚregisterre   r>   r<   Ú<module>r«      sO   ðÛ ã ç 3Ñ 3Ý #ß FÝ  Ý +ôF$�Iô F$ðR,Ð ðZ × Ñ × Ñ Ð-=Ð Ò >r>   