Ë
    ¤ehË(  ã                   óŽ   — d dl Zd dlZd dlmc mZ d dlmZm	Z	 d dl
mZmZmZ d dlmZ  ej                   d«      Z G d„ d«      Zy)é    N)Ú	DataFrameÚ
date_range)Ú_check_legend_labelsÚ_check_legend_markerÚ_check_text_labels)ÚVersionÚ
matplotlibc                   ób  — e Zd Zej                  j                  d¬«      d„ «       Zd„ Zej                  j                  dg d¢«      d„ «       Z	d„ Z
d	„ Zd
„ Zd„ Zd„ Zd„ Zej                  j                  dddd ej                   d ej$                  d«      ¬«      ddg«      d„ «       Zd„ Zd„ Zy)ÚTestFrameLegendzLOpen bug in matplotlib https://github.com/matplotlib/matplotlib/issues/11357)Úreasonc                 ó€  — ddl m} ddlm} t	        ddddœddddœg«      }|j                  dd	d
dd
¬«      }|j                  dddd |d¬«       |j                  «       }t        t        j                  «      t        d«      k  r|j                  }n|j                  }t        |d   |«      sJ ‚t        |d   |«      sJ ‚y )Nr   )ÚLineCollection)ÚLine2Dé   )ÚxÚaÚbé   é   r   r   Úorangegš™™™™™¹?)ÚcÚyerrÚlabelr   Úblue)r   r   Úaxr   ú3.7)Úmatplotlib.collectionsr   Úmatplotlib.linesr   r   ÚplotÚ
get_legendr   ÚmplÚ__version__ÚlegendHandlesÚlegend_handlesÚ
isinstance)Úselfr   r   Údfr   ÚlegendÚresult_handless          úk/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/pandas/tests/plotting/frame/test_frame_legend.pyÚtest_mixed_yerrzTestFrameLegend.test_mixed_yerr   s·   € õ 	:Ý+ä˜a a¨aÑ0¸ÀÈÑ2JÐKÓLˆà�W‰W�S˜# °¸8ˆWÓDˆØ
�‰��S˜F¨°"¸FˆÔCà—‘“ˆÜ”3—?‘?Ó#¤g¨e£nÒ4Ø#×1Ñ1‰Nà#×2Ñ2ˆNä˜.¨Ñ+¨^Ô<Ð<Ð<Ü˜.¨Ñ+¨VÔ4Ð4Ñ4ó    c                 ó–  — t        ddgddgdœ«      }t        dddgi«      }|j                  ddd	dœd
¬«      }|j                  dddi|¬«       |j                  «       }t        t        j
                  «      t        d«      k  r|j                  }n|j                  }|D �cg c]  }|j                  «       ‘Œ }}g d¢}||k(  sJ ‚y c c}w )Nr   r   r   )r   r   Údg      @Tr   Úgreenr   )r(   ÚcolorÚsecondary_yÚred)r(   r0   r   r   )r   r/   r2   )	r   r   r    r   r!   r"   r#   r$   Ú	get_color)	r&   r'   Údf2r   r(   ÚhandlesÚhandleÚresultÚexpecteds	            r*   Útest_legend_falsez!TestFrameLegend.test_legend_false.   sÆ   € ä˜a ˜V¨1¨a¨&Ñ1Ó2ˆÜ˜˜s C˜jÐ)Ó*ˆà�W‰W˜D¨f¸7Ñ(CÐQTˆWÓUˆØ�‰˜ S¨% L°RˆÔ8Ø—‘“ˆÜ”3—?‘?Ó#¤g¨e£nÒ4Ø×*Ñ*‰Gà×+Ñ+ˆGØ3:Ö;¨�&×"Ñ"Õ$Ð;ˆÐ;Ú+ˆØ˜Ò!Ð!Ñ!ùò <s   Â!CÚkind)ÚlineÚbarÚbarhÚkdeÚareaÚhistc                 ó  — t        j                  d«       t        t        j                  j                  d«      j	                  d«      g d¢¬«      }t        t        j                  j                  d«      j	                  d«      g d¢¬«      }t        t        j                  j                  d«      j	                  d«      g d¢¬«      }t        t        j                  j                  d«      j	                  d«      g d¢¬«      }|j                  |d	¬
«      }t        ||j                  ¬«       |j                  |d|¬«      }t        ||j                  ¬«       |j                  |d	|¬«      }t        ||j                  j                  |j                  «      ¬«       |j                  |d|¬«      }t        |j                  j                  |j                  «      «      t        t        |j                  «      «      z   }t        ||¬«       y )NÚscipyr   ©r   r   ©r   r   r   ©Úcolumns©r.   ÚeÚf©ÚgÚhÚi)ÚjÚkÚlT©r:   r(   ©ÚlabelsF)r:   r(   r   Úreverse)ÚpytestÚimportorskipr   ÚnpÚrandomÚdefault_rngr   r   rF   ÚunionÚlistÚreversed)r&   r:   r'   r4   Údf3Údf4r   r8   s           r*   Útest_df_legend_labelsz%TestFrameLegend.test_df_legend_labels>   sx  € ä×Ñ˜GÔ$Ü”r—y‘y×,Ñ,¨QÓ/×6Ñ6°vÓ>ÊÔXˆÜÜ�I‰I×!Ñ! !Ó$×+Ñ+¨FÓ3º_ô
ˆô Ü�I‰I×!Ñ! !Ó$×+Ñ+¨FÓ3º_ô
ˆô Ü�I‰I×!Ñ! !Ó$×+Ñ+¨FÓ3º_ô
ˆð �W‰W˜$ tˆWÓ,ˆÜ˜R¨¯
©
Õ3à�X‰X˜4¨°"ˆXÓ5ˆÜ˜R¨¯
©
Õ3à�X‰X˜4¨°ˆXÓ4ˆÜ˜R¨¯
©
×(8Ñ(8¸¿¹Ó(EÕFà�X‰X˜4¨	°bˆXÓ9ˆÜ˜Ÿ
™
×(Ñ(¨¯©Ó5Ó6¼¼hÀsÇ{Á{Ó>SÓ9TÑTˆÜ˜R¨Ö1r,   c                 ó`  — t        j                  d«       t        t        j                  j                  d«      j	                  d«      g d¢¬«      }t        t        j                  j                  d«      j	                  d«      g d¢¬«      }t        t        j                  j                  d«      j	                  d«      g d¢¬«      }|j                  dd	¬
«      }t        |g d¢¬«       |j                  d|¬«      }t        |g d¢¬«       |j                  ddd|¬«      }t        |g d¢¬«       y )NrB   r   rC   rD   rE   rG   rJ   Tr   ©r(   r1   ©r   ú	b (right)r   rR   F©r(   r   r<   rL   )r:   r(   r1   r   )r   rc   r   rK   z	h (right)rM   )rU   rV   r   rW   rX   rY   r   r   )r&   r'   r4   r]   r   s        r*   Ú!test_df_legend_labels_secondary_yz1TestFrameLegend.test_df_legend_labels_secondary_yY   sç   € Ü×Ñ˜GÔ$Ü”r—y‘y×,Ñ,¨QÓ/×6Ñ6°vÓ>ÊÔXˆÜÜ�I‰I×!Ñ! !Ó$×+Ñ+¨FÓ3º_ô
ˆô Ü�I‰I×!Ñ! !Ó$×+Ñ+¨FÓ3º_ô
ˆð �W‰W˜D¨cˆWÓ2ˆÜ˜RÒ(?Õ@Ø�X‰X˜U rˆXÓ*ˆÜ˜RÒ(?Õ@Ø�X‰X˜5¨¸3À2ˆXÓFˆÜ˜RÒ(VÖWr,   c                 ó|  — t        j                  d«       t        dd¬«      }t        t        j
                  j                  d«      j                  d«      g d¢|¬«      }t        t        j
                  j                  d«      j                  d«      g d	¢|¬«      }t        t        j
                  j                  d«      j                  d«      g d
¢|¬«      }|j                  dd¬«      }t        |g d¢¬«       |j                  d|¬«      }t        |g d¢¬«       |j                  d|¬«      }t        |g d¢¬«       y )NrB   ú1/1/2014r   ©Úperiodsr   rC   rD   ©rF   ÚindexrG   rJ   Tr   ra   rb   rR   Frd   )r   rc   r   rK   rL   rM   )
rU   rV   r   r   rW   rX   rY   Ústandard_normalr   r   ©r&   Úindr'   r4   r]   r   s         r*   Ú!test_df_legend_labels_time_seriesz1TestFrameLegend.test_df_legend_labels_time_seriesj   s   € ä×Ñ˜GÔ$Ü˜¨QÔ/ˆÜÜ�I‰I×!Ñ! !Ó$×4Ñ4°VÓ<Ú#Øô
ˆô
 Ü�I‰I×!Ñ! !Ó$×4Ñ4°VÓ<Ú#Øô
ˆô
 Ü�I‰I×!Ñ! !Ó$×4Ñ4°VÓ<Ú#Øô
ˆð
 �W‰W˜D¨cˆWÓ2ˆÜ˜RÒ(?Õ@Ø�X‰X˜U rˆXÓ*ˆÜ˜RÒ(?Õ@Ø�X‰X˜T bˆXÓ)ˆÜ˜RÒ(NÖOr,   c                 óÀ  — t        j                  d«       t        dd¬«      }t        t        j
                  j                  d«      j                  d«      g d¢|¬«      }t        t        j
                  j                  d«      j                  d«      g d	¢|¬«      }t        t        j
                  j                  d«      j                  d«      g d
¢|¬«      }|j                  j                  ddd¬«      }t        |dg¬«       |j                  j                  dddd|¬«      }t        |dg¬«       |j                  j                  ddd|¬«      }t        |ddg¬«       y )NrB   rg   r   rh   r   rC   rD   rj   rG   rJ   r   r   Údata1)r   Úyr   rR   r.   rH   FÚdata2)r   rr   r(   r   r   rK   rL   Údata3)r   rr   r   r   )rU   rV   r   r   rW   rX   rY   rl   r   Úscatterr   rm   s         r*   Ú)test_df_legend_labels_time_series_scatterz9TestFrameLegend.test_df_legend_labels_time_series_scatter„   s$  € ä×Ñ˜GÔ$Ü˜¨QÔ/ˆÜÜ�I‰I×!Ñ! !Ó$×4Ñ4°VÓ<Ú#Øô
ˆô
 Ü�I‰I×!Ñ! !Ó$×4Ñ4°VÓ<Ú#Øô
ˆô
 Ü�I‰I×!Ñ! !Ó$×4Ñ4°VÓ<Ú#Øô
ˆð �W‰W�_‰_˜s c°ˆ_Ó9ˆÜ˜R¨¨	Õ2Ø�X‰X×Ñ  s°5ÀÈBÐÓOˆÜ˜R¨¨	Õ2Ø�X‰X×Ñ  s°'¸bÐÓAˆÜ˜R¨°'Ð(:Ö;r,   c                 ó4  — t        j                  d«       t        dd¬«      }t        t        j
                  j                  d«      j                  d«      g d¢|¬«      }|j                  d	«      }|j                  d
¬«      }t        |d
g¬«       |j                  d
d¬«      }t        |dg¬«       t        |j                  j                  «       d	«       |j                  dd|¬«      }t        |ddg¬«       |j                  j                  «       d
dgk(  sJ ‚y )NrB   rg   r   rh   r   rC   rD   rj   r   r   )rr   rR   ÚLABEL_b)rr   r   r   ÚLABEL_c)rr   r   r   )rU   rV   r   r   rW   rX   rY   rl   Ú	set_indexr   r   r   ÚxaxisÚ	get_labelrF   Útolist)r&   rn   r'   Údf5r   s        r*   Ú+test_df_legend_labels_time_series_no_mutatez;TestFrameLegend.test_df_legend_labels_time_series_no_mutateŸ   së   € Ü×Ñ˜GÔ$Ü˜¨QÔ/ˆÜÜ�I‰I×!Ñ! !Ó$×4Ñ4°VÓ<Ú#Øô
ˆð �l‰l˜3ÓˆØ�X‰X˜ˆX‹_ˆÜ˜R¨¨Õ.Ø�X‰X˜ 9ˆXÓ-ˆÜ˜R¨¨Õ4Ü˜2Ÿ8™8×-Ñ-Ó/°Ô5Ø�X‰X˜ 9°ˆXÓ4ˆÜ˜R¨°IÐ(>Õ?Ø�{‰{×!Ñ!Ó#¨¨S zÒ1Ð1Ñ1r,   c           	      ó"  — t        g d¢g d¢gg d¢¬«      }t        j                  j                  dd¬«      \  }}|j	                  dd	d
dd	|d
   ¬«       |j	                  ddddd|d
   ¬«       |j	                  ddddd|d
   ¬«       t        |d
   g d¢¬«       t        |d
   g d¢¬«       |j	                  ddddd|d   ¬«       |j	                  dd	d
dd	|d   ¬«       |j	                  ddddd|d   ¬«       t        |d   g d¢¬«       t        |d   g d¢¬«       |j	                  ddddd|d   ¬«       |j	                  ddddd|d   ¬«       |j	                  dd	d
dd	|d   ¬«       t        |d   g d¢¬«       t        |d   g d¢¬«       y )N)r   r   r   r   )r   r   é   é   )r   ÚrrK   r   )ÚdatarF   r   r   )ÚnrowsÚncolsr   rƒ   r   Úo)r   rr   Ú	linewidthÚmarkerr0   r   rK   r   )rƒ   rK   r   rR   )r‡   r   r‡   ©Úexpected_markers)r   rƒ   rK   )r‡   r‡   r   r   )rK   r   rƒ   )r   r‡   r‡   ©r   r!   ÚpyplotÚsubplotsr   r   r   )r&   r'   Ú_r   s       r*   Ú*test_missing_marker_multi_plots_on_same_axz:TestFrameLegend.test_missing_marker_multi_plots_on_same_ax´   s�  € äš\ª<Ð8ÒBVÔWˆÜ—
‘
×#Ñ#¨!°1Ð#Ó5‰ˆˆ2à
�‰�#˜¨°#¸SÀRÈÁUˆÔKØ
�‰�#˜¨°#¸SÀRÈÁUˆÔKØ
�‰�#˜¨°#¸SÀRÈÁUˆÔKÜ˜R ™Uª?Õ;Ü˜R ™U²_ÕEà
�‰�#˜¨°#¸SÀRÈÁUˆÔKØ
�‰�#˜¨°#¸SÀRÈÁUˆÔKØ
�‰�#˜¨°#¸SÀRÈÁUˆÔKÜ˜R ™Uª?Õ;Ü˜R ™U²_ÕEà
�‰�#˜¨°#¸SÀRÈÁUˆÔKØ
�‰�#˜¨°#¸SÀRÈÁUˆÔKØ
�‰�#˜¨°#¸SÀRÈÁUˆÔKÜ˜R ™Uª?Õ;Ü˜R ™U²_ÖEr,   c                 óF  — t        t        j                  j                  d«      j	                  d«      t        j
                  g d¢«      t        j
                  g d¢«      g¬«      }ddg|j                  _        |j                  «       }|j                  j                  «       }t        |d«       t        t        j                  j                  d«      j	                  d	«      «      }|j                  d
|¬«      }|j                  j                  «       }t        |d«       d|j                  _        |j                  d|¬«      }|j                  j                  «       }t        |d«       |j                  d
|¬«      }|j                  j                  «       }t        |d«       y )Nr   )r�   r�   )r   r   r   r   )r   rr   r   rr   rE   ÚgroupÚ
individualzgroup,individual)é   r”   Trd   ÚnewF)r   rW   rX   rY   rl   ÚarrayrF   Únamesr   Úlegend_Ú	get_titler   Úname)r&   Úmultir   Ú	leg_titler'   s        r*   Útest_legend_namez TestFrameLegend.test_legend_nameË   s;  € ÜÜ�I‰I×!Ñ! !Ó$×4Ñ4°VÓ<Ü—X‘XÒ2Ó3´R·X±XÒ>RÓ5SÐTô
ˆð  '¨Ð5ˆ�‰Ôà�Z‰Z‹\ˆØ—J‘J×(Ñ(Ó*ˆ	Ü˜9Ð&8Ô9ä”r—y‘y×,Ñ,¨QÓ/×?Ñ?ÀÓGÓHˆØ�W‰W˜D RˆWÓ(ˆØ—J‘J×(Ñ(Ó*ˆ	Ü˜9Ð&8Ô9àˆ�
‰
ŒØ�W‰W˜E bˆWÓ)ˆØ—J‘J×(Ñ(Ó*ˆ	Ü˜9Ð&8Ô9à�W‰W˜D RˆWÓ(ˆØ—J‘J×(Ñ(Ó*ˆ	Ü˜9 eÕ,r,   r;   r<   r=   r>   rB   )Úmarksr?   r@   c                 óº   — t        t        j                  j                  d«      j                  d«      g d¢¬«      }|j	                  |d¬«      }t        |d¬«       y )Nr   rC   rD   rE   FrQ   )Úvisible)r   rW   rX   rY   r   r   )r&   r:   r'   r   s       r*   Útest_no_legendzTestFrameLegend.test_no_legendä   sF   € ô ”r—y‘y×,Ñ,¨QÓ/×6Ñ6°vÓ>ÊÔXˆØ�W‰W˜$ uˆWÓ-ˆÜ˜R¨Ö/r,   c                 ó8  — t        t        j                  j                  d«      j	                  d«      g d¢¬«      }|j                  dgdd¬«      }|j                  d	gd
d|¬«       |j                  dgdd|¬«       t        |g d¢¬«       t        |g d¢¬«       y )Nr   )r‚   r   ©ÚAÚBÚCrE   r¤   r   Úsolid)rr   r‰   Ú	linestyler¥   r‡   Údotted)rr   r‰   r¨   r   r¦   ú<rR   )r   r‡   rª   rŠ   )r   rW   rX   rY   rl   r   r   r   )r&   r'   r   s      r*   Útest_missing_markers_legendz+TestFrameLegend.test_missing_markers_legendô   sƒ   € äÜ�I‰I×!Ñ! !Ó$×4Ñ4°VÓ<Âoô
ˆð �W‰W˜�u S°GˆWÓ<ˆØ
�‰�3�% ¨x¸BˆÔ?Ø
�‰�3�% ¨x¸BˆÔ?ä˜RªÕ8Ü˜R²/ÖBr,   c                 óì   — t        g d¢g d¢g d¢g d¢dœ«      }t        j                  j                  «       \  }}dD ]  }|j	                  d|||d¬«       Œ t        |g d	¢¬
«       t        |g d¢¬«       y )N)r   r   r   r�   r”   é   )r   r�   r   r   r   r�   )r   r   r   r­   r�   r   )r¤   r¥   r¦   ÚXÚABCr®   ú.)r   r   Ústyler£   rR   )r°   r°   r°   rŠ   rŒ   )r&   r'   r�   r   r:   s        r*   Ú'test_missing_markers_legend_using_stylez7TestFrameLegend.test_missing_markers_legend_using_style   sp   € äâ'Ú'Ú'Ú'ñ	ó
ˆô —
‘
×#Ñ#Ó%‰ˆˆ2Øò 	=ˆDØ�G‰G�C˜ T¨b¸ˆGÕ<ð	=ô 	˜RªÕ8Ü˜R²/ÖBr,   N)Ú__name__Ú
__module__Ú__qualname__rU   ÚmarkÚxfailr+   r9   Úparametrizer_   re   ro   rv   r   r�   r�   ÚparamÚtdÚ
skip_if_nor¡   r«   r²   © r,   r*   r   r      sÜ   „ Ø‡[�[×ÑðDð ó ñ5óð5ò&"ð  ‡[�[×Ñ˜VÒ%SÓTñ2ó Uð2ò4Xò"Pò4<ò62ò*Fò.-ð2 ‡[�[×ÑØàØØØˆF�L‰L˜ m b§m¡m°GÓ&<Ô=ØØð	
ó
ñ0ó
ð0ò

CóCr,   r   )ÚnumpyrW   rU   Úpandas.util._test_decoratorsÚutilÚ_test_decoratorsrº   Úpandasr   r   Úpandas.tests.plotting.commonr   r   r   Úpandas.util.versionr   rV   r!   r   r¼   r,   r*   ú<module>rÄ      sE   ðÛ Û ç )Ð )÷÷ñ õ
 (à€f×Ñ˜,Ó'€÷|Cò |Cr,   