403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.221
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/matplotlib/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/matplotlib/__pycache__/spines.cpython-312.pyc
�

G8�cS���ddlmZddlZddlZddlZddlmZmZddl	m
Z
ddlmZ
ddlmZddlmZGd�dej(�ZGd�d�ZGd	�d
e�Zy)�)�MutableMappingN)�_api�
_docstring)�allow_rasterizationc���eZdZdZd�Zej�fd��Zd�Zd�Z	d�Z
d�Z�fd�Zd�fd	�	Z
d
�Zd�Zd�Zd
�Zd�Ze�fd��Zd�Zd�Zd�Zdd�Zd�Zed��Zed��Zed��Zd�Z�xZS)�Spineay
    An axis spine -- the line noting the data area boundaries.

    Spines are the lines connecting the axis tick marks and noting the
    boundaries of the data area. They can be placed at arbitrary
    positions. See `~.Spine.set_position` for more information.

    The default position is ``('outward', 0)``.

    Spines are subclasses of `.Patch`, and inherit much of their behavior.

    Spines draw a line, a circle, or an arc depending on if
    `~.Spine.set_patch_line`, `~.Spine.set_patch_circle`, or
    `~.Spine.set_patch_arc` has been called. Line-like is the default.

    For examples see :ref:`spines_examples`.
    c��y)Nr���selfs �3/usr/lib/python3/dist-packages/matplotlib/spines.py�__str__z
Spine.__str__ s���c���t�|�d	i|��||_|j|jj�||_|j
d�|jtjd�|jtjd�|jd�d|_|jd�|j|jj�d|_d|_t%j&t(j*|��||_d|_t1j2�|_y)
a�
        Parameters
        ----------
        axes : `~matplotlib.axes.Axes`
            The `~.axes.Axes` instance containing the spine.
        spine_type : str
            The spine type.
        path : `~matplotlib.path.Path`
            The `.Path` instance used to draw the spine.

        Other Parameters
        ----------------
        **kwargs
            Valid keyword arguments are:

            %(Patch:kwdoc)s
        �nonezaxes.edgecolorzaxes.linewidth�
projectingNg@)�path�liner
)�super�__init__�axes�
set_figure�figure�
spine_type�
set_facecolor�
set_edgecolor�mpl�rcParams�
set_linewidth�set_capstyle�axis�
set_zorder�
set_transform�	transData�_bounds�	_positionr�check_isinstance�mpath�Path�_path�_patch_type�mtransforms�IdentityTransform�_patch_transform)rrrr�kwargs�	__class__s     �r
rzSpine.__init__#s����&	���"�6�"���	�����	�	�(�(�)�$������6�"����3�<�<�(8�9�:����3�<�<�(8�9�:����,�'���	���������4�9�9�.�.�/����
������e�j�j�t�4���
�"���!,� =� =� ?��rc��d|_||_|dz|_|dz|_||_||_tjj||�|_	|j|jj�d|_
y)zSet the spine to be arc-like.�arc�TN)r+�_center�_width�_height�_theta1�_theta2r(r)r2r*r#r�	transAxes�stale)r�center�radius�theta1�theta2s     r
�
set_patch_arczSpine.set_patch_arcXsj�� �������q�j�����z����������Z�Z�^�^�F�F�3��
����4�9�9�.�.�/���
rc��d|_||_|dz|_|dz|_|j	|j
j�d|_y)zSet the spine to be circular.�circler3TN)r+r4r5r6r#rr9r:)rr;r<s   r
�set_patch_circlezSpine.set_patch_circleesF��#�������q�j�����z������4�9�9�.�.�/���
rc� �d|_d|_y)zSet the spine to be linear.rTN)r+r:rs r
�set_patch_linezSpine.set_patch_lineos��!�����
rc��|jdvsJ�|j|jd�|j|jd�f}|j|j�}|j|j
�}t
j�j|dz|dz�j|�|_
y)a!
        Notes
        -----
        This cannot be called until after this has been added to an Axes,
        otherwise unit conversion will fail. This makes it very important to
        call the accessor method and not directly access the transformation
        member variable.
        �r2rAr���?N)r+�convert_xunitsr4�convert_yunitsr5r6r,�Affine2D�scale�	translater.)rr;�width�heights    r
�_recompute_transformzSpine._recompute_transformus������#4�4�4�4��%�%�d�l�l�1�o�6��%�%�d�l�l�1�o�6�8���#�#�D�K�K�0���$�$�T�\�\�2��!�� 4� 4� 6�
�U�5�3�;����
-�
�Y��! ��rc�t��|jdvr|j�|jSt�|��S)NrF)r+rPr.r�get_patch_transform)rr0s �r
rRzSpine.get_patch_transform�s8������0�0��%�%�'��(�(�(��7�.�0�0rc���|j�t�|�	|��}|j�|S|g}|jjdg}t|jj�dkDr(|j|jjd�|D�]�}|j�}|j}|j}|dk(rd}	d}
n|dk(rd}	d}
nd}	d}
|	|zdz|jjz}	|
|zdz|jjz}
|jj�ro|jdk(r)|j |	z
|_|j"|
z|_n7|jd	k(r(|j$|	z
|_|j&|
z|_|j(j�ro|jd
k(r)|j"|	z|_|j |
z
|_n7|jdk(r(|j&|	z|_|j$|	z
|_|j|����t*j,j/|�S)a
        Return the window extent of the spines in display space, including
        padding for ticks (but not their labels)

        See Also
        --------
        matplotlib.axes.Axes.get_tightbbox
        matplotlib.axes.Axes.get_window_extent
        )�rendererrrG�out�inrH�H�left�bottom�right�top)�_adjust_locationr�get_window_extentr!�
majorTicks�len�
minorTicks�append�frozen�_size�_tickdirr�dpi�	tick1line�get_visibler�x0�x1�y0�y1�	tick2liner,�Bbox�union)rrT�bb�bboxes�tickstocheck�tick�bb0�tickl�tickdir�padout�padinr0s           �r
r]zSpine.get_window_extent�s���	
����
�W�
&��
&�
9���9�9���I�����	�	�,�,�Q�/�0���t�y�y�#�#�$�q�(�
����	�	� 4� 4�Q� 7�8� �	�D��)�)�+�C��J�J�E��m�m�G��%�������D�����������e�^�b�(�4�;�;�?�?�:�F��E�M�B�&������8�E��~�~�)�)�+��?�?�f�,� �V�V�f�_�C�F� �V�V�e�^�C�F��_�_��0� �V�V�f�_�C�F� �V�V�e�^�C�F��~�~�)�)�+��?�?�g�-� �V�V�f�_�C�F� �V�V�e�^�C�F��_�_��-� �V�V�f�_�C�F� �V�V�f�_�C�F��M�M�#��?	�B���%�%�f�-�-rc��|jS�N)r*rs r
�get_pathzSpine.get_path�����z�z�rc�b�|j�#d|_|j|j�yy)N)�outward�)r&�set_positionrs r
�_ensure_position_is_setzSpine._ensure_position_is_set�s*���>�>�!�-�D�N����d�n�n�-�"rc�l�||_|j�|jj�d|_y)z�
        Register an axis.

        An axis should be registered with its corresponding spine from
        the Axes instance. This allows the spine to clear any axis
        properties when needed.
        NT)r!�clearr:)rr!s  r
�
register_axiszSpine.register_axis�s*����	��9�9� ��I�I�O�O����
rc�`�d|_|j�|jj�yy)zClear the current spine.N)r&r!r�rs r
r�zSpine.clear�s&������9�9� ��I�I�O�O��!rc��|jdk(ry|j�|j\}}n||jdvr$|jjj\}}nJ|jdvr$|jjj
\}}nt
d|j����|jdk(�r)|jdv�r	|jj�}	|jj�}||z|z}||z|z}||kDr||}}tjjtj|�tj|��|_|jd
k(rp|jjj\}}	|jj#�}||z
||z
z}||_||_yt
d|jz��y|j j(}	|	j*dk(sJd
��|jdvr||	d<||	d<y|jdvr||	d<||	d<yt
d|jz��#t$rd}Y���wxYw#t$rd	}Y��zwxYw#t$r|}Y��wxYw)z4Automatically set spine bounds to the view interval.rAN�rXrZ�r[rY�unknown spine spine_type: r2�rYr[rGrrYz#unable to set bounds for spine "%s")r3r3zunexpected vertices shape�rrG)rGrG)rr�rGr)rr%r�viewLim�	intervaly�	intervalx�
ValueErrorr+�get_theta_direction�AttributeError�get_theta_offsetr(r)r2�np�rad2degr*�get_roriginr6r5�vertices�shape)
r�low�high�	direction�offset�rmin�rmax�rorigin�scaled_diameter�v1s
          r
r\zSpine._adjust_location�sr���?�?�h�&���<�<�#����I�C��
�_�_� 1�
1��	�	�)�)�3�3�I�C��
�_�_� 1�
1��	�	�)�)�3�3�I�C���9�$�/�/�9J�K�L�L����u�$����"3�3�"� $�	�	� =� =� ?�I��!�Y�Y�7�7�9�F��I�o��.���i�'�&�0����:� $�c��C�"�Z�Z�^�^�B�J�J�s�O�R�Z�Z��=M�N��
��?�?�h�.�!%���!2�!2�!<�!<�J�D�$�'�"&�)�)�"7�"7�"9��(,�g�~�$��.�&I�O�#2�D�L�"1�D�K�!�!F�!%���"1�2�2�/����$�$�B��8�8�v�%�B�'B�B�%����"3�3���4����4�����$5�5���4����4�� �!F�!%���"1�2�2��I&�"� !�I�"��&���F���*�'�"&��'�s6�	I�$I*�I<�I'�&I'�*I9�8I9�<J
�	J
c�T��|j�t�|�	|�}d|_|S)NF)r\r�drawr:)rrT�retr0s   �r
r�z
Spine.draws)��������g�l�8�$����
��
rc�
�|dvrn+t|�dk7rtd��|ddvrtd��||_|j|j	��|j
�|j
j
�d|_y)	a�
        Set the position of the spine.

        Spine position is specified by a 2 tuple of (position type,
        amount). The position types are:

        * 'outward': place the spine out from the data area by the specified
          number of points. (Negative values place the spine inwards.)
        * 'axes': place the spine at the specified Axes coordinate (0 to 1).
        * 'data': place the spine at the specified data coordinate.

        Additionally, shorthand notations define a special positions:

        * 'center' -> ``('axes', 0.5)``
        * 'zero' -> ``('data', 0.0)``

        Examples
        --------
        :doc:`/gallery/spines/spine_placement_demo`
        )r;�zeror3z&position should be 'center' or 2-tupler)r}r�dataz:position[0] should be one of 'outward', 'axes', or 'data' NT)r_r�r&r#�get_spine_transformr!�reset_ticksr:)r�positions  r
rzSpine.set_position#s���*�)�)���8�}��!� �!I�J�J���{�"=�=� �"6�7�7�!������4�3�3�5�6��9�9� ��I�I�!�!�#���
rc�:�|j�|jS)zReturn the spine position.)r�r&rs r
�get_positionzSpine.get_positionFs���$�$�&��~�~�rc�d�|j�|j}t|t�r|dk(rd}n|dk(rd}t	|�dk(sJd��|\}}tjgd�|��|jd	vr|jjd
��}nC|jdvr|jjd
��}ntd
|j����|dk(rd|dk(r|Sddddd�|j}|tj|�zdz}|tjg|�|j j"���zS|dk(rk|jd	vr'tj$j'dddd|d�|zS|jdvr'tj$j'ddddd|�|zSy|dk(r�|jdvr|dz}|jd	vrctj(tj$�j+|d�|jj,z|jj,�S|jdvrctj(|jj,tj$�j+d|�|jj,z�Syy)zReturn the spine transform.r;)rrHr�)r�rr3zposition should be 2-tuple)rr}r�)�
position_typer��grid)�whichr�r�r}r)���rr�)rr�r�)rXrZrYr[rWrrGr�r�)rZr[N)r�r&�
isinstance�strr_r�
check_in_listrr�get_yaxis_transform�get_xaxis_transformr�r��arrayr,�ScaledTranslationr�dpi_scale_transrK�from_values�blended_transform_factoryrMr$)rr�r��amount�base_transform�
offset_vec�offset_dotss       r
r�zSpine.get_spine_transformKs����$�$�&��>�>���h��$��8�#�(���V�#�&���8�}��!�?�#?�?�!� (��
�v����6�)6�	8��?�?�/�/�!�Y�Y�:�:��:�H�N�
�_�_� 1�
1�!�Y�Y�:�:��:�H�N��9�$�/�/�9L�M�N�N��I�%���{�%�%�&-��(/�� � $���1�
�%�r�x�x�
�';�;�b�@��&�%�7�7�G�(�G�*.�+�+�*E�*E�G�G�H��f�
$����"3�3�#�,�,�8�8��A�q�!�V�Q�O�(�)�*����$5�5�#�,�,�8�8��A�q�!�Q��O�(�)�*�6��f�
$����"2�2��!������"3�3�"�<�<��(�(�*�4�4�V�Q�?��i�i�)�)�*��I�I�'�'�)�)����$5�5�"�<�<��I�I�'�'��(�(�*�4�4�Q��?��i�i�)�)�*�+�+�6�%rc���|jdk(rtd��|�tj|�r|\}}|j	�xsd\}}|�|}|�|}||f|_d|_y)a�
        Set the spine bounds.

        Parameters
        ----------
        low : float or None, optional
            The lower spine bound. Passing *None* leaves the limit unchanged.

            The bounds may also be passed as the tuple (*low*, *high*) as the
            first positional argument.

            .. ACCEPTS: (low: float, high: float)

        high : float or None, optional
            The higher spine bound. Passing *None* leaves the limit unchanged.
        rAz5set_bounds() method incompatible with circular spinesN�NNT)rr�r��iterable�
get_boundsr%r:)rr�r��old_low�old_highs     r
�
set_boundszSpine.set_bounds�sw��"�?�?�h�&��G�I�
I��<�B�K�K��,��I�C�� �O�O�-�=������;��C��<��D��T�{�����
rc��|jS)zGet the bounds of the spine.)r%rs r
r�zSpine.get_bounds�s���|�|�rc��|dk(rtjddg�}ne|dk(rtjddg�}nH|dk(rtjddg�}n+|dk(rtjddg�}ntd	|z��||||fi|��}|jtj
d
j
|��|S)z#Create and return a linear `Spine`.rX)r~�+����?rZ)��?r�rY)r�r~r[)r�r�z"unable to make path for spine "%s"zaxes.spines.{0})r(r)r��set_visiblerr�format)�clsrrr/r�results      r
�linear_spinezSpine.linear_spine�s�������:�:�|�\�:�;�D�
�7�
"��:�:�|�\�:�;�D�
�8�
#��:�:�|�\�:�;�D�
�5�
 ��:�:�|�\�:�;�D��A�J�N�O�O��T�:�t�6�v�6�����3�<�<�(9�(@�(@��(L�M�N��
rc��tjj||�}||||fi|��}	|	j||||�|	S)z!Create and return an arc `Spine`.)r(r)r2r?)
r�rrr;r<r=r>r/rr�s
          r
�	arc_spinezSpine.arc_spine�sD���z�z�~�~�f�f�-���T�:�t�6�v�6�����V�V�V�V�<��
rc��tjj�}d}||||fi|��}|j||�|S)z%Create and return a circular `Spine`.rA)r(r)�unit_circlerB)r�rr;r<r/rrr�s        r
�circular_spinezSpine.circular_spine�sC���z�z�%�%�'���
��T�:�t�6�v�6�������/��
rc�4�|j|�d|_y)aL
        Set the edgecolor.

        Parameters
        ----------
        c : color

        Notes
        -----
        This method does not modify the facecolor (which defaults to "none"),
        unlike the `.Patch.set_color` method defined in the parent class.  Use
        `.Patch.set_facecolor` to set the facecolor.
        TN)rr:)r�cs  r
�	set_colorzSpine.set_color�s��	
���1����
rryr�) �__name__�
__module__�__qualname__�__doc__rr�dedent_interpdrr?rBrDrPrRr]rzr�r�r�r\rr�rr�r�r�r��classmethodr�r�r�r��
__classcell__)r0s@r
rrs�����"����2@��2@�h��� �$1�6.�p�.���82�t����!�F�
9+�v�<�����$��������rrc�"�eZdZdZd�Zd�Zd�Zy)�SpinesProxya[
    A proxy to broadcast ``set_*`` method calls to all contained `.Spines`.

    The proxy cannot be used for any other operations on its members.

    The supported methods are determined dynamically based on the contained
    spines. If not all spines support a given method, it's executed only on
    the subset of spines that support it.
    c��||_yry)�_spine_dict)r�
spine_dicts  r
rzSpinesProxy.__init__�s
��%��rc��|jj�D�cgc]}t||�r|��}}|jd�r|st	d|�d���d�}tj|||�}|dj|_|Scc}w)N�set_z''SpinesProxy' object has no attribute '�'c�6�|D]}t||�|i|���yry)�getattr)�_targets�	_funcname�argsr/�spines     r
�xz"SpinesProxy.__getattr__.<locals>.x�s'��!�
;��)���y�)�4�:�6�:�
;rr)r��values�hasattr�
startswithr��	functools�partialr�)r�namer��broadcast_targetsr�s     r
�__getattr__zSpinesProxy.__getattr__�s���04�0@�0@�0G�0G�0I�6�u� '��t� 4�#�6��6����v�&�.?� �9�$��q�A�C�
C�	;�
���a�!2�D�9��%�a�(�0�0��	����6s�Bc��g}|jj�D]#}|jd�t|�D���%t	tt
|���S)Nc3�BK�|]}|jd�r|���y�w)r�N)r�)�.0r�s  r
�	<genexpr>z&SpinesProxy.__dir__.<locals>.<genexpr>�s%����L�!�4�?�?�6�3J��L�s�)r�r��extend�dir�list�sorted�set)r�namesr�s   r
�__dir__zSpinesProxy.__dir__�s]�����%�%�,�,�.�	L�E��L�L�L�%(��Z�L�
L�	L��F�3�u�:�&�'�'rN)r�r�r�r�rr�r�r
rr
r�r��s���&��(rr�c�V�eZdZdZd�Zed��Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zy)
�Spinesa�
    The container of all `.Spine`\s in an Axes.

    The interface is dict-like mapping names (e.g. 'left') to `.Spine` objects.
    Additionally, it implements some pandas.Series-like features like accessing
    elements by attribute::

        spines['top'].set_visible(False)
        spines.top.set_visible(False)

    Multiple spines can be addressed simultaneously by passing a list::

        spines[['top', 'right']].set_visible(False)

    Use an open slice to address all spines::

        spines[:].set_visible(False)

    The latter two indexing methods will return a `SpinesProxy` that broadcasts
    all ``set_*`` calls to its members, but cannot be used for any other
    operation.
    c��||_yry��_dict)rr/s  r
rzSpines.__init__s	����
rc��|di|��S�Nr
r
)r��ds  r
�	from_dictzSpines.from_dicts
���x�Q�x�rc��|jSryrrs r
�__getstate__zSpines.__getstate__ r{rc�(�|jdi|��yr)r)r�states  r
�__setstate__zSpines.__setstate__#s����
�
���rc�Z�	|j|S#t$rtd|�d���wxYw)Nz$'Spines' object does not contain a 'z' spine)r�KeyErrorr�)rr�s  r
r�zSpines.__getattr__&sC��	F��:�:�d�#�#���	F� �6�t�f�G�D�F�
F�	F�s��*c��t|t�ru|D�cgc]}||jvs�|��}}|rtdj	|���t|jj
�D��cic]\}}||vr||��c}}�St|t�rtd��t|t�rD|j�-|j�!|j�t|j�Std��|j|Scc}wcc}}w)Nz, z/Multiple spines must be passed as a single listzYSpines does not support slicing except for the fully open slice [:] to access all spines.)
r�r�rr�joinr��items�tupler��slice�start�stop�step)r�key�k�unknown_keys�vs     r
�__getitem__zSpines.__getitem__-s����c�4� �'*�B�!�a�t�z�z�.A�A�B�L�B���t�y�y��6�7�7�����1A�1A�1C� -���A�#$��8�!"�1�� -�.�
.��c�5�!��N�O�O��c�5�!��y�y� �S�X�X�%5�#�(�(�:J�"�4�:�:�.�.� �;�<�<��z�z�#����C�� -s�D�D�-D	
c�"�||j|<yryr)rr�values   r
�__setitem__zSpines.__setitem__?s����
�
�3�rc��|j|=yryr)rrs  r
�__delitem__zSpines.__delitem__Cs
���J�J�s�Orc�,�t|j�Sry)�iterrrs r
�__iter__zSpines.__iter__Gs���D�J�J��rc�,�t|j�Sry)r_rrs r
�__len__zSpines.__len__Js���4�:�:��rN)r�r�r�r�rr�rr
r
r�rrr!r$r&r
rr
rrsI���,�������F��$ �� �rr)�collections.abcrr��numpyr��
matplotlibrrr�matplotlib.artistr�matplotlib.transforms�
transformsr,�matplotlib.patches�patches�mpatches�matplotlib.pathrr(�Patchrr�rr
rr
�<module>r2sL��*����'�1�+�%��N�H�N�N�N�b (� (�FI�^�Ir

Youez - 2016 - github.com/yon3zu
LinuXploit