+
     ]i/  c                   s   R t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RI	H
t ^ RIHt ^ RIHt  ! R R4      t ! R R4      t ! R R	4      t]P(                  ]P*                  ]P,                  .t. ROt ! R
 R4      t ! R R4      tR t ! R R4      t ! R R4      t ! R R4      t]P>                  PA                  R4      ]! R.R7      R 4       4       t!R t"R t#R t$R# )z#Catch all for categorical functionsN)Axes)check_figures_equalc                   s  a  ] tR t^t o RR.^ .33RR.^ .33R. RO. RO33.t]! ]!  w  tt]P                  P                  R]]R7      R	 4       tR
 tRR]P                  3RR^.3RR^.3.t]! ]!  w  tt]P                  P                  R]]R7      R 4       t]P                  P                  R]]R7      R 4       tRtV tR# )TestUnitDatasinglehello worldunicode   Здравствуйте мирmixedAz
data, locsidsc                s    \         P                  ! V4      p\        VP                  P	                  4       4      V8X  g   Q h\        VP                  P                  4       4      V8X  g   Q hR # N)catUnitDatalist_mappingkeysvalues)selfdatalocsunit   &&& E/usr/lib64/python3.14/site-packages/matplotlib/tests/test_category.py	test_unitZTestUnitData.test_unit   sP    ||D!DMM&&()T111DMM((*+t333    c                s   R R.p^ ^.p. ROp. ROp. ROp\         P                  ! V4      p\        VP                  P	                  4       4      V8X  g   Q h\        VP                  P                  4       4      V8X  g   Q hVP                  V4       \        VP                  P	                  4       4      V8X  g   Q h\        VP                  P                  4       4      V8X  g   Q hR# )adN)br   e)r   r   r   r   )             )r   r   r   r   r   r   update)r   r   r   Zdata_updateZunique_dataZupdated_locsr   s   &      r   test_updateZTestUnitData.test_update   s    Sz1v%*#||D!DMM&&()T111DMM((*+t333K DMM&&()[888DMM((*+|;;;r   Q	@nanr   z
mixed typefdatac                s    \         P                  ! \        4      ;_uu_ 4        \        P                  ! V4       R R R 4       R #   + '       g   i     R # ; ir   )pytestraises	TypeErrorr   r   )r   r&      &&r   test_non_string_failsZ"TestUnitData.test_non_string_fails0   s,    ]]9%%LL &%%%s   AA	c                s    \         P                  ! 4       p\        P                  ! \        4      ;_uu_ 4        VP                  V4       R R R 4       R #   + '       g   i     R # ; ir   )r   r   r'   r(   r)   r"   )r   r&   Zunitdata   && r   test_non_string_update_failsZ)TestUnitData.test_non_string_update_fails5   s7    <<>]]9%%OOE" &%%%s   AA%	 N)r   znp.nanBz3.14   мир)r   r   r    r!      )Znumberr$   )__name__
__module____qualname____firstlineno__
test_caseszipr
   r   r'   markparametrizer   r#   npr%   failing_test_casesfidsr&   r+   r-   __static_attributes____classdictcell__Z__classdict__   @r   r   r      s    }os34 ABQCHIC,. /0J Z IC[[\4S94 :4
<  +UBFFO!D":.Qx0HJ z"KD%[[We6  7  [[We6# 7#r   r   c                   s&   a  ] tR t^<t o R tRtV tR# )FakeAxisc                s    Wn         R # r   units)r   rC   r*   r   __init__ZFakeAxis.__init__=   s    
r   rB   N)r2   r3   r4   r5   rD   r=   r>   r?   r@   r   rA   rA   <   s      r   rA   c                   s  a  ] tR t^At o RtRR.3RR.3R. R O3RRR	.3R
. R!O3.t]! ]!  w  ttRRR]	P                  .3RR^*.3.t]! ]!  w  tt]P                  ! RR7      R 4       t]P"                  P%                  R]]R7      R 4       t]P"                  P%                  RRR.RR.R7      R 4       t]P"                  P%                  R]]R7      R 4       tR tR tRtV tR# )"TestStrCategoryConverterz
Based on the pandas conversion and factorization tests:

ref: /pandas/tseries/tests/test_converter.py
     /pandas/tests/test_algos.py:TestFactorize
r   r   asciir   r   zinteger string1Z2zsingle + values>10r   r   r$   string integer42T)Zautousec                s    \         P                  ! 4       V n        \         P                  ! 4       V n        \        V P                  4      V n        R # r   )r   ZStrCategoryConverterccr   r   rA   ax)r   Zrequestr*   r   	mock_axisZ"TestStrCategoryConverter.mock_axisX   s/    **,LLN	499%r   valsr	   c                s    \         P                  P                  V P                  P	                  WP
                  P                  V P
                  4      \        \        V4      4      4       R # r   )	r:   testingassert_allcloserJ   convertrK   rC   rangelen)r   rM   r*   r   test_convertZ%TestStrCategoryConverter.test_convert_   s@    


""477??43777$<#(T#3	5r   valuehir0   c                st    V P                   P                  WP                  V P                  4      ^ 8X  g   Q hR# r   N)rJ   rP   r   rK   )r   rT   r*   r   test_convert_one_stringZ0TestStrCategoryConverter.test_convert_one_stringe   s'    wwuii9Q>>>r   fvalsc                s    \         P                  ! \        4      ;_uu_ 4        V P                  P	                  WP
                  V P                  4       R R R 4       R #   + '       g   i     R # ; ir   )r'   r(   r)   rJ   rP   r   rK   )r   rX   r*   r   test_convert_failZ*TestStrCategoryConverter.test_convert_faili   s:    ]]9%%GGOOE99dgg6 &%%%s   1AA/	c                s   V P                   P                  V P                  V P                  4      p\	        VP
                  \        P                  4      '       g   Q h\	        VP                  \        P                  4      '       g   Q hR # r   )
rJ   Zaxisinfor   rK   
isinstanceZmajlocr   StrCategoryLocatorZmajfmtStrCategoryFormatter)r   axis   & r   test_axisinfoZ&TestStrCategoryConverter.test_axisinfon   sZ    ww		4773$++s'='=>>>>$++s'?'?@@@@r   c                s    \        V P                  P                  R .V P                  4      \        P
                  4      '       g   Q hR# )r   N)rZ   rJ   Zdefault_unitsrK   r   r   r      &r   test_default_unitsZ+TestStrCategoryConverter.test_default_unitss   s0    $''//tww?NNNNr   )rK   rJ   r   Nr   r   c)r   r/   ZCZDZEZFZGZHZIZJZKZLZMZNZOZPZQZRZSZTZUZVZWZXZYZZ)r2   r3   r4   r5   __doc__r6   r7   r
   r   r:   Zinfr;   r<   fvaluesr'   fixturerL   r8   r9   rS   rW   rY   r_   rb   r=   r>   r?   r@   r   rE   rE   A   sK     @AB]O,_-#c3Z0' *C D	EJ z"KC"T3$78+dBZ8: +,MD'^^D!& "& [[VV55 65
 [[WtX&6Wi<PQ? R? [[Wg487 97A
O Or   rE   c                   sn   a  ] tR t^{t o R t]P                  P                  R]]	R7      R 4       t
RtV tR# )TestStrCategoryLocatorc                s   . ROp\         P                  ! V Uu. uF  p\        V4      NK  	  up4      p\         P                  ! VP                  4      p\
        P                  P                  VP                  RR4      V4       R# u upi )r   N)r   r   r    r!   r1         i   i   i	   
   )	r   r   Zstrr[   r   r:   rN   assert_array_equalZtick_values)r   r   Zjr   tickss   &    r   test_StrCategoryLocatorZ.TestStrCategoryLocator.test_StrCategoryLocator|   sb    1||T2TSVT23&&t}}5


%%e&7&7d&CTJ 3s   Bplotterr	   c                s    \         P                  ! 4       P                  4       pV! V. RO. RO4       \        P                  P                  VP                  P                  P                  4       \        ^4      4       R# )r   N)r   r    r!   rc   )
pltfiguresubplotsr:   rN   rl   yaxismajorZlocatorrQ   r   ro   rK   r,   r   test_StrCategoryLocatorPlotZ2TestStrCategoryLocator.test_StrCategoryLocatorPlot   sK    ZZ\""$I/


%%bhhnn&<&<&>aIr   r.   N)r2   r3   r4   r5   rn   r'   r8   r9   	PLOT_LISTPLOT_IDSrv   r=   r>   r?   r@   r   rh   rh   {   s8     K [[Y	x@J AJr   rh   c                   s  a  ] tR t^t o R. RO3RRR.3.t]! ]!  w  tt]P                  P                  R]]R7      R 4       t]P                  P                  R]]R7      ]P                  P                  R]]R7      R	 4       4       tR
tV tR# )TestStrCategoryFormatterrF   r      Здравствуйте   приветydatar	   c                s    \         P                  ! V4      p\         P                  ! VP                  4      p\	        V4       F$  w  rEV! WD4      V8X  g   Q hV! VR 4      V8X  d   K$  Q h	  R # r   )r   r   r\   r   	enumerate)r   r|   r   labelsir      &&    r   test_StrCategoryFormatterZ2TestStrCategoryFormatter.test_StrCategoryFormatter   s[    ||E"))$--8e$DA!<1$$$!T?a''' %r   ro   c                sj   \         P                  ! 4       P                  4       pV! V\        \	        V4      4      V4       \        V4       F1  w  rEVP                  P                  P                  V4      V8X  d   K1  Q h	  VP                  P                  P                  X^,           4      R8X  g   Q hR# )r   Z N)	rp   rq   rr   rQ   rR   r}   rs   rt   	formatter)r   r|   ro   rK   r   r   s   &&&   r   test_StrCategoryFormatterPlotZ6TestStrCategoryFormatter.test_StrCategoryFormatterPlot   s     ZZ\""$E#e*%u-e$DA88>>++A.!333 %xx~~''!,222r   r.   N)helloworldrU   )r2   r3   r4   r5   r6   r7   r
   Zcasesr'   r8   r9   r   rw   rx   r   r=   r>   r?   r@   r   ry   ry      s     459>JKMJ j!JC[[We5( 6( [[We5[[Y	x@3 A 63r   ry   c                 sd   \        \        \        V4      4      4      p\        P                  P                  V P                  4       V4       V Uu. uF  q0P                  P                  W34      NK  	  ppYA Uu. uF"  p\        P                  P                  V4      NK$  	  up8X  g   Q h\        V P                  P                  P                  4       4      V Uu. uF  qUNK  	  up8X  g   Q h\        V P                  P                  P                  4       4      V8X  g   Q hR # u upi u upi u upi r   )r   rQ   rR   r:   rN   rl   Zget_majorticklocsrt   r   r   r\   Z_textrC   r   r   r   )r]   r~   rm   r   Zgraph_labelsZlr   r   	axis_testr      s    s6{#$EJJ!!$"8"8":EB8=>1JJ((.L>vNv!C44::1=vNNNN

##((*+6/B6a6/BBBB

##**,-666	 ?N/Bs   #D#9(D(
D-c                   s   a  ] tR t^t o R. R
O3R. RO3R]P
                  ! . RO4      3.t]! ]!  w  tt	]
P                  P                  R]]R7      ]
P                  P                  R]	]R7      R 4       4       tRtV tR	# )TestPlotBytesstring list
bytes listbytes ndarrayro   r	   bdatac                    \         P                  ! 4       P                  4       p\        P                  ! . RO4      pV! W2V4       \        VP                  V4       R# r1   N)r1   rj   ri   rp   rq   rr   r:   arrayr   xaxis)r   ro   r   rK   counts   &&&  r   test_plot_bytesZTestPlotBytes.test_plot_bytes   >     ZZ\""$)$6""((E"r   r.   Nrc   )s   as   bs   c)r2   r3   r4   r5   r:   r   Zbytes_casesr7   Z	bytes_idsZ
bytes_datar'   r8   r9   rw   rx   r   r=   r>   r?   r@   r   r   r      s     !?3 "45#RXX.@%ABDK  -Iz[[Y	x@[[Wji@# A A#r   r   c                   s(  a  ] tR t^t o R. RO3R]P
                  ! . RO4      3R. RO3R]P
                  ! . RO4      3.t]! ]!  w  tt	]
P                  P                  R]]R7      ]
P                  P                  R]	]R7      R 4       4       tR	tV tR
# )TestPlotNumliker   zstring ndarrayr   r   ro   r	   ndatac                r   r   r   )r   ro   r   rK   r   r   r   test_plot_numlikeZ!TestPlotNumlike.test_plot_numlike   r   r   r.   N)rG   Z11Z3)s   1s   11s   3)r2   r3   r4   r5   r:   r   Znumlike_casesr7   Znumlike_idsZnumlike_datar'   r8   r9   rw   rx   r   r=   r>   r?   r@   r   r   r      s     #%56&1A(BC"$78%rxx0C'DEGM !$] 3K[[Y	x@[[WlD# E A#r   r   c                   sV  a  ] tR t^t o ]P
                  P                  R]]R7      R 4       t	]P                  R 4       t]P
                  P                  R4      ]P
                  P                  R]]R7      R 4       4       t]P
                  P                  R4      ]P
                  P                  R]]R7      R 4       4       t]P
                  P                  R4      ]P
                  P                  R]]R7      R 4       4       t]P
                  P                  R]]R7      R	 4       tR
 tRRR.3RR^.3RR^*.3RR]P&                  .3.t]! ]!  w  tt]P2                  ]P4                  ]P6                  ! ]P8                  ]P
                  P:                  R7      .t]P
                  P                  R]4      ]P
                  P                  R]]R7      R 4       4       t]P
                  P                  R]4      ]P
                  P                  R]]R7      R 4       4       t Rt!V t"R# )TestPlotTypesro   r	   c                s    \         P                  ! 4       P                  4       pR R.pV! W#^ ^.4       \        VP                  V4       R# )rz   r{   N)rp   rq   rr   r   r   )r   ro   rK   Zwordss   &&  r   test_plot_unicodeZTestPlotTypes.test_plot_unicode   s<    ZZ\""$+^<Aq6""((E"r   c                sN    . ROV n         . ROV n        . ROV n        . ROV n        R# )r   N)r   Zhappyr   )r    rj   r!   )ZPythonZisZfun)r!   r1   ri   xxyyyxr`   ra   r   	test_dataZTestPlotTypes.test_data   s    ,(r   r   c                s    \         P                  ! 4       P                  4       pV! W0P                  V P                  4       \        VP                  V P                  4       R # r   )rp   rq   rr   r   r   r   r   r   r   ro   rK   r   r   test_plot_xaxisZTestPlotTypes.test_plot_xaxis   s<     ZZ\""$FFDGG$"((DFF#r   c                s    \         P                  ! 4       P                  4       pV! W0P                  V P                  4       \        VP                  V P                  4       R # r   )rp   rq   rr   r   r   r   rs   r   r   r   test_plot_yaxisZTestPlotTypes.test_plot_yaxis   s<     ZZ\""$GGTVV$"((DFF#r   c                s   \         P                  ! 4       P                  4       pV! W0P                  V P                  4       \        VP                  V P                  4       \        VP                  V P                  4       R # r   )rp   rq   rr   r   r   r   r   rs   r   r   r   test_plot_xyaxisZTestPlotTypes.test_plot_xyaxis   sN     ZZ\""$FFDFF#"((DFF#"((DFF#r   c                s    \         P                  ! 4       P                  4       pV! VR R.RR.4       V! V. RO. RO4       V! V. RO. RO4       \        VP                  . R	O4       \        VP
                  . R
O4       R# r   r   r   gN)r   r   r   )fr   r   )r   rd   r   )r   r   r   )r   r   r   rd   )r   r   r   r   r   r   )rp   rq   rr   r   r   rs   ru   r,   r   test_update_plotZTestPlotTypes.test_update_plot   s`    ZZ\""$S#Jc
+O_5O_5"((01"((:;r   c                s0   \         P                  ! 4       P                  4       pVP                  R R.RR.4       VP	                  . RO. RO4       VP                  . RO. RO4       \        VP                  . R	O4       \        VP                  . R
O4       R# r   )	rp   rq   rr   scatterplotbarr   r   rs   )r   rK   r^   r   %test_update_plot_heterogenous_plotterZ3TestPlotTypes.test_update_plot_heterogenous_plotter   sf    ZZ\""$


C:Sz*
1
0"((01"((:;r   r   r   r$   znumber integerrG   rH   rI   ZmissingZ12)Zmarksxdatac                s    \         P                  ! 4       P                  4       p\        P                  ! \
        4      ;_uu_ 4        V! W2^^.4       RRR4       R#   + '       g   i     R# ; i)r   Nrp   rq   rr   r'   r(   r)   r   ro   r   rK   r   r   test_mixed_type_exceptionZ'TestPlotTypes.test_mixed_type_exception  sD     ZZ\""$]]9%%B1v& &%%%s   AA-	c                s    \         P                  ! 4       P                  4       p\        P                  ! \
        4      ;_uu_ 4        V! V^ ^.^^.4       V! W2^^.4       RRR4       R#   + '       g   i     R# ; irV   r   r   r   r    test_mixed_type_update_exceptionZ.TestPlotTypes.test_mixed_type_update_exception  sX     ZZ\""$]]9%%BAA'B1v& &%%%s   A**A;	r   N)#r2   r3   r4   r5   r'   r8   r9   rw   rx   r   rg   r   Zusefixturesr   r   r   r   r   r:   r%   r;   r7   r<   rf   r    r   r   Zparamr   ZxfailZplottersr   r   r=   r>   r?   r@   r   r   r      sB    [[Y	x@# A# ^^  [[[)[[Y	x@$ A *$
 [[[)[[Y	x@$ A *$
 [[[)[[Y	x@$ A *$ [[Y	x@< A<< #S$K0+c1X6+dBZ8$tRVVn57
 +,MD'dhhTYYfkk.?.?@BH [[Y1[[Wg48' 9 2'
 [[Y1[[Wg48' 9 2'r   r   ZdefaultZpng)Z
extensionsc           	      s   ^ RI H p V! R^^4      pV! R^^4      pV! R^^4      pV! R^^4      pV P                  4       pVP                  4       p\        Wx./ \        RRR7      34       F  w  rV	P                  ! W4.RR.3/ V
B  V	P
                  P                  pV	P                  P                  pV	P                  ! WV.RR.3/ V
B  WP
                  P                  J g   Q hWP                  P                  J d   K  Q h	  R# )r   )datetimei  N)ZxunitsZyunitsZV1ZV2)r   rr   r7   Zdictr   r   rC   rs   )Zfig_testZfig_refr   Zt0Zt1Zt2Zt3Zax_testZax_refrK   ZkwargsZx_unitsZy_unitss   &&           r   test_overriding_units_in_plotr     s     "	$1	B	$1	B	$1	B	$1	B!GF7+t4=>@
 	4,1&1((..((..
4,1&1((..(((((..(((@r   c                 s    \         P                  ! 4       w  rVP                  P                  RR.4       VP	                  . . 4       R# )zI
Smoke test to check that no deprecation warning is emitted. See #22640.
r   r   N)rp   rr   r   Zupdate_unitsr   r   rK        r   !test_no_deprecation_on_empty_datar   4  s4     LLNEAHH3*%GGBOr   c                  s    \         P                  ! 4       w  rVP                  . RO4      w  r#pVP                  R8X  g   Q h\        P
                  P                  V. RO4       R# )r   N)r   r   r   rd   Zff)rk   )
g       @        r         ?r   r   r   r   r   r   )rp   rr   ZhistZshaper:   rN   rO   )ZfigrK   ZnZbinsZpatchess        r   	test_histr   =  sJ    llnGCww9:AW77eJJq"JKr   c                  s    \         P                  ! 4       w  rVP                  . RO. RO4       \        P                  ! 4       ;_uu_ 4        VP                  RR4       RRR4       R#   + '       g   i     R# ; i)r   r   rd   N)r   r   rd   r   )r   r    r!   r1   )rp   rr   r   warningsZcatch_warningsZset_xlimr   r   r   test_set_limr   D  sL     LLNEAGG ,/		 	 	"	"
C 
#	"	"	"s   A((A9	)r   r   r   )%re   r   r'   Znumpyr:   Z
matplotlibZmplZmatplotlib.axesr    Zmatplotlib.pyplotZpyplotrp   Zmatplotlib.categoryZcategoryr   Zmatplotlib.testing.decoratorsr   r   rA   rE   r   r   r   rw   rx   rh   ry   r   r   r   r   ZstyleZcontextr   r   r   r   r.   r   r   <module>r      s    )        ! =+# +#\ 
3O 3Ol \\499dhh/	%J J3 307# # # # M' M'` 9() ) ).Lr   