| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Python312/Lib/site-packages/pandas/tests/plotting/__pycache__/ |
Upload File : |
�
0 �g�A � � � d Z ddlmZ ddlmZ ddlZddlmZ ddl Z
ddl mZ ddlm
Z erddlmZ ddlmZ dd �Zdd
�Zd� Zdd�Zdd d
�Zd� Zd!d�Zd� Zd"d�Zd#d�Zd!d�Zd$d�Zd%d�Z dd�Z i fd�Z!d&d�Z"d� Z#d� Z$d'd�Z%d� Z&d� Z'y)(zF
Module consolidating common testing functions for checking plotting.
� )�annotations)�
TYPE_CHECKINGN)�is_list_like)�Series)�Sequence��Axesc �� � |r
|�t d� �t | � } | D ]Q }|r;|j � �J �t |j � j � |� �@|j � ��QJ � y)a)
Check each axes has expected legend labels
Parameters
----------
axes : matplotlib Axes object, or its list-like
labels : list-like
expected legend labels
visible : bool
expected legend visibility. labels are checked only when visible is
True
Nz-labels must be specified when visible is True)�
ValueError�_flatten_visible�
get_legend�_check_text_labels� get_texts)�axes�labels�visible�axs �>C:\Python312\Lib\site-packages\pandas/tests/plotting/common.py�_check_legend_labelsr sp � � �F�N��H�I�I��D�!�D�� +����=�=�?�.�.�.��r�}�}��8�8�:�F�C��=�=�?�*�*�*�+� c �� � |r
|�t d� �|r8| j � \ }}|D �cg c] }|j � �� }}||k( sJ �y| j � �J �yc c}w )a
Check ax has expected legend markers
Parameters
----------
ax : matplotlib Axes object
expected_markers : list-like
expected legend markers
visible : bool
expected legend visibility. labels are checked only when visible is
True
Nz.Markers must be specified when visible is True)r �get_legend_handles_labels�
get_markerr
)r �expected_markersr �handles�_�handle�markerss r �_check_legend_markerr / sp � � �$�,��I�J�J���1�1�3�
���5<�=�6�6�$�$�&�=��=��*�*�*�*��}�}��&�&�&�� >s �Ac �8 � ddl m} | j � }|j � }t |� t |� k( sJ �t ||� D ]; \ }}|j � }|j � }t
j ||� �= |j d� y)z�
Check each axes has identical lines
Parameters
----------
xp : matplotlib Axes object
rs : matplotlib Axes object
r N�all) �matplotlib.pyplot�pyplot� get_lines�len�zip�
get_xydata�tm�assert_almost_equal�close) �xp�rs�plt�xp_lines�rs_lines�xpl�rsl�xpdata�rsdatas r �_check_datar4 F s� � � $��|�|�~�H��|�|�~�H��x�=�C��M�)�)�)���(�+� /���S����!�����!��
���v�v�.�/�
�I�I�e�r c �| � ddl m} t | |� st | � s| g} | D ] }|j � |k( r�J � y)z�
Check each artist is visible or not
Parameters
----------
collections : matplotlib Artist or its list-like
target Artist or its list or collection
visible : bool
expected visibility
r )�
CollectionN)�matplotlib.collectionsr6 �
isinstancer �get_visible)�collectionsr r6 �patchs r �_check_visibler<