+
     ]ib  c            	       s
   ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIt^ RIt	^ RI
Ht ^ RIt^ RIHtHt ^ RIHt ^ RIHt ^ RIt^ RIHt ^ RIHt ^ RIH t ^ RIH t! ^ RI"H#t# ^ RI$H%t& ^ RIH't' ^ RI(H)t) R	 t*R
 t+]! R.RR7      R 4       t,]! R.RR7      R 4       t-]! R.4      R 4       t.R t/R t0]! R.RR7      R 4       t1]! R.R]Pd                  ! 4       R8X  d   ^ MRR7      R 4       t3]! R.R]Pd                  ! 4       R8X  d   ^ MRR7      R 4       t4]! R.R]Pd                  ! 4       R8X  d   ^ MRR7      R  4       t5]! R!.R]Pd                  ! 4       R8X  d   ^ MRR7      R" 4       t6]! R#.RR$R7      R% 4       t7]! R&.R]Pd                  ! 4       R8X  d   ^ MR'R7      R( 4       t8]! R)R*.RR7      R+ 4       t9]! R,.RR7      R- 4       t:]! R..RR/R07      R1 4       t;R2 t<R3 t=]! R4.R57      R6 4       t> ! R7 R84      t? ! R9 R:4      t@R; tA]! R<.]Pd                  ! 4       R8X  d   ^ MR=R>7      R? 4       tBR@ tCRA tDRB tE]! RC.4      RD 4       tF]! RE.4      RF 4       tGRG tHRH tIRI tJRJ tK]! RK.RRL]Pd                  ! 4       R8X  d   ^ MRMRN7      RO 4       tLRP tMRQ tNRR tORS tPRT tQRU tR]P                  P                  RVR4      RW 4       tU]P                  P                  RXR4      RY 4       tV]P                  P                  RXR4      RZ 4       tW]P                  P                  RVR4      R[ 4       tX]P                  P                  R\R4      R] 4       tYR^ tZR_ t[R` t\Ra t]Rb t^Rc t_Rd t`Re taRf tbRg tcRh tdRi teRj tf]P                  P                  R\R4      Rk 4       tgRl thRm tiRn tjRo tkRp tl]P                  P                  Rq4      Rr 4       tn]P                  P                  RsR4      Rt 4       toRu tp]Rv 4       tqRw trRx ts]P                  P                  RyRzR{.R]	P                  ! RzR{.4      .4      R| 4       tu]P                  P                  R}R~^]v.4      R 4       tw]P                  P                  RyRzR{.R]	P                  ! RzR{.4      .4      R 4       txR tyR tzR t{R t|R t}R t~R tR t]! R4.R57      R 4       tR tR tR tR tR tR tR tR tR tR t]P                  P                  Rq4      R 4       tR tR tR tR tR# )    N)mock)assert_allclose)check_figures_equalimage_comparison)needs_usetex)HandlerTuple)
rc_context)FontPropertiesc                  s*   \         P                  P                  ^
4      p \         P                  P                  ^
4      pR.^,          R.^,          ,           pR.^,          R.^,          ,           p\        P                  ! 4       w  rE\        WW#4       F  w  rgrVP                  WgWR7       K  	  VP                  4       w  r\        P                  ! \        W*4      4      pVP                  VP                  4       VP                  4       RR	R7       R# )

   abrglabelccenter left)locbbox_to_anchorN)         ?)nprandomZrandnpltsubplotszipscatterget_legend_handles_labelscollectionsZOrderedDictlegendZvaluesZkeys)ZXZYlabelscolorsfigaxxyr   colorhandlesr                  C/usr/lib64/python3.14/site-packages/matplotlib/tests/test_legend.pytest_legend_ordereddictr)      s     			A
		AUQY#"FUQY#"FllnGC!!7e


1u
. 8 224OG$$S%9:FIIfmmov{{}  9    c                  s    \         P                  ! 4       w  rVP                  ^ ^.4       VP                  ^ ^.4       R VP                  4        4       pR R 4       pVP	                  W#RR7       R# )r    c              3   $   "   T F  qx  K  	  R # 5iN ).0line   & r(   	<genexpr>(test_legend_generator.<locals>.<genexpr>3   s     /t   c              3   r+   r,   r-   )r.   r   r0   r(   r1   r2   4   s     2!1e!1r3   
upper leftr   N)ZspamZeggs)r   r   plot	get_linesr   )r!   r"   r&   r          r(   test_legend_generatorr9   -   sX    llnGCGGQFOGGQFO//G2!12FIIg<I0r*   zlegend_auto1.pngT)remove_textc                 s    \         P                  ! 4       w  r\        P                  ! ^d4      pVP	                  V^2V,
          RRR7       VP	                  W"^2,
          RRR7       VP                  RR7       R# )Test automatic legend placementoy=1r   y=-1bestr5   N)r   r   r   aranger6   r   )r!   r"   r#         r(   test_legend_auto1rC   9   sZ     llnGC
		#AGGArAvs%G(GGA2vs&G)II&Ir*   zlegend_auto2.pngc                 s   \         P                  ! 4       w  r\        P                  ! ^d4      pVP	                  W"RRR7      pVP	                  W"RRR
1,          RRR7      pVP                  V^ ,          V^ ,          .RR.RR	7       R# )r;   Zedgem)Zalignr%   Nr   ZupZdownr@   r5   )r   r   r   rA   barr   )r!   r"   r#   Zb1Zb2        r(   test_legend_auto2rH   C   sp     llnGC
		#A	F#	.B	TrT7&	4BIIr!ubentVn&I9r*   zlegend_auto3.pngc                 s    \         P                  ! 4       w  r. R	Op. R
OpVP                  W#RRR7       VP                  RR4       VP	                  RR4       VP                  RR7       R# )r;   o-r/   r>                 ?r@   r5   N?皙?rN   rM   rM   r   ffffff?rP   皙?rQ   r   r   )r   r   r6   set_xlimset_ylimr   )r!   r"   r#   r$   r8   r(   test_legend_auto3rT   M   sW     llnGC&A*AGGA$fG%KKSKKSII&Ir*   c                 s   \         P                  ! ^RR7      w  r. p\        VP                  R4       F  w  r4VP	                  V4       VP                  ^ .^^	.,          ,           \        ^
4      RVR7       VP                  RR7      pV P                  P                  4        VP                  VP                  4       P                  VP                  P                  4       4      4       K  	  \        V^,          P                   V^ ,          P                   4       \        V^,          P                   V^ ,          P                   4       R# )	z~
Check that the legend location with automatic placement is the same,
whatever the histogram type is. Related to issue #9580.
ncolsfigsizeLegend)Zbinsr   Zhisttyper@   r5   N)g@g333333@)rF   stepZ
stepfilled)r   r   r   flatZ	set_titlehistranger   canvasdrawappendget_window_extenttransformed	transAxesinvertedr   bounds)r!   axs
leg_bboxesr"   Zhtleg         r(   test_legend_auto4ri   Y   s     ||!Z8HCJchh =>
R
ae%)8bIiiFi#

!!#//0E0E0GH	J ? JqM((*Q-*>*>?JqM((*Q-*>*>?r*   c                 s   \         P                  ! ^RR7      w  r. p\        VP                  R4       EF$  w  r4\        P
                  ! RRRRR7      \        P                  ! \        P                  ! ^ ^.^ ^ .^^ .^^.RR.RR	.R	R	.R	R.R	R..	4      RR
7      \        P                  ! RR^ RRRR7      3 F  pVP                  V4       K  	  VP                  R	R.RR.RR7       VP                  VR7      pV P                  P                  4        VP                  VP!                  4       P#                  VP$                  P'                  4       4      4       EK'  	  \)        V^,          P*                  V^ ,          P*                  4       R# )zu
Check that the automatic placement handle a rather complex
case with non rectangular patch. Related to issue #9580.
rU   r   rM   皙?皙?C1)xywidthZheightfcrK   rN   )ro   ih  rQ   ZC0)rn   ro   z	A segmentr>   r5   N)g333333#@g333333@centerr@   )r   rM   )r   r   )r   r   r   rZ   mpatchesZEllipseZPolygonr   arrayZWedge	add_patchr6   r   r]   r^   r_   r`   ra   rb   rc   r   rd   )r!   re   rf   r"   r   Z_patchrg   s          r(   test_legend_auto5ru   o   sf   
 ||!Z8HCJsxx!34
   !STC  FQFQFQFS#Jc
#Jc
S#J+8 "9=AC z33dtLF LL  	c
S#Jk:iiCi 

!!#//0E0E0GH	J% 5* JqM((*Q-*>*>?r*   zlegend_various_labels.pngc                  sn   \         P                  ! 4       p V P                  ^y4      pVP                  \        P
                  ! ^4      R^R7       VP                  \        P                  ! ^R4      RRR7       VP                  \        P
                  ! ^^R	4      RRR7       VP                  ^RR7       R# )
y   r<   r>   gffffff@u   DéveloppésZ__nolegend__r@   )	numpointsr   NrE   )r   figureZadd_subplotr6   r   rA   linspacer   r!   r"        r(   test_various_labelsr|      s     **,C		BGGBIIaL#QG'GGBKK3NG;GGBIIaBNG;IIvI&r*   zlegend_labels_first.pngZx86_64g9v?)r:   tolc                  s\   \         P                  ! 4       w  rVP                  \        P                  ! ^
4      R^R7       VP                  \        P
                  ! ^
4      ^,          RRR7       VP                  \        P                  ! ^^
R4      RRR7       VP                  RRR	7       R
# )r	   -or>   z:xr#   dZdiamondr@   F)r   ZmarkerfirstNrE   )r   r   r6   r   rA   Zonesr   rz   r{   r(   test_labels_firstr      sx     llnGCGGBIIbM4qG)GGBGGBKM4sG+GGBIIb"b!3iG8II&eI,r*   zlegend_multiple_keys.pngc                  s&   \         P                  ! 4       w  rVP                  . ROR4      w  pVP                  . R	OR4      w  pVP                  . R
OR4      w  pVP                  W#3W23V.. RO^W#3\	        RR7      W23\	        R^ R7      /R7       R# )r   r~   z-xz-dN)ndivide)r   Zpad)rw   handler_mapr         r   r      r   r      )ztwo keyszpad=0zone key)r   r   r6   r   r   )r!   r"   p1p2Zp3rG   r(   test_multiple_keysr      s     llnGC
'')T
"CB
'')T
"CB
'')T
"CBIIx"2&(H8\$%?8\$A%FH  Ir*   zrgba_alpha.pnggQ?c                  s    \         P                  ! 4       w  rVP                  \        ^
4      ^R7       \         P                  ! R.RR7      pVP
                  P                  . RO4       R# )r	   lwLonglabel that will go awayrq   r5   Nr   r    r    r   )r   r   r6   r\   r   legendPatchset_facecolorr!   r"   rg   rB   r(   test_alpha_rgbar      sK     llnGCGGE"I!G
**34(
CCOO!!.1r*   zrcparam_alpha.pngc                  sT   \         P                  ! 4       w  rVP                  \        ^
4      ^R7       \        P
                  ! RR/R7      ;_uu_ 4        \         P                  ! R.RR7      pVP                  P                  . R	O4       RRR4       R#   + '       g   i     R# ; i)
r	   r   zlegend.framealphag      ?)Zrcr   rq   r5   Nr   )	r   r   r6   r\   mplr   r   r   r   r   rB   r(   test_alpha_rcparamr      sq     llnGCGGE"I!G	/5	6	6jj78hG
 	%%n5 
7	6	6	6s   7BB'	z	fancy.pngrQ   c            	      s   \         P                  ! ^y4       \         P                  ! ^.^
,          RRR7       \         P                  ! \        P
                  ! ^
4      \        P
                  ! ^
^ R4      RR7       \         P                  ! \        P
                  ! ^
4      \        P
                  ! ^
4      RRRR7       \         P                  ! RRR.^R	R
^R7       R# )rv   zo--ZXXr>   zXX
XXr   )ZxerrZyerrr   r   rK   T	My legend)r   r   rV   shadowtitlerw   NrE   )r   subplotr6   r   r   rA   Zerrorbarr   r-   r*   r(   
test_fancyr      s    
 KKHHaS2XuD)KK		"ryyQ38DLL2		"C'JJ=#st;!Er*   
framealphag~jt?c                  s    \         P                  ! ^^d^d4      p T p\        P                  ! WR^
R7       \        P                  ! RR7       R# )r   Zmylabel)r   r   r   )r   N)r   ry   r   r6   r   )r#   r$   r{   r(   test_framealphar      s7     	AsC A	AHHQr*JJ#r*   zscatter_rc3.pngzscatter_rc1.pngc                  s(   \         P                  ! 4        \         P                  ! ^y4      p V P                  \        P
                  ! ^
4      \        P
                  ! ^
^ R4      RR7       V P                  RRR.RR7       ^\        P                  R&   \         P                  ! 4        \         P                  ! ^y4      p V P                  \        P
                  ! ^
4      \        P
                  ! ^
^ R4      R	R7       V P                  RRR.RR7       R
# )rv   Zthreer>   r   rK   r   r   )r   r   r   zlegend.scatterpointsoneNrE   )	r   rx   r   r   r   rA   r   r   rcParams)r"       r(   test_rcr      s     JJL	S	BJJryy}biiAr2'JBII-c
  ! ,-CLL'(JJL	S	BJJryy}biiAr2%J@II-c
  !r*   zlegend_expand.pngc                 s   RR.p \         P                  ! \        V 4      ^4      w  r\        P                  ! ^d4      p\        W 4       F  w  rEVP                  V^2V,
          RRR7       VP                  RVR7      pVP                  V4       VP                  W3^2,
          RRR7       VP                  R	VR7      pVP                  V4       VP                  R
V^R7       K  	  R# )zTest expand modeNZexpandr<   r=   r>   r4   )r   moder?   right
lower left)r   r   rV   )	r   r   Zlenr   rA   r   r6   r   
add_artist)Zlegend_modesr!   re   r#   r"   r   Zl1Zl2           r(   test_legend_expandr      s     (#L||C-q1HC
		#A*
263e,YY<dY3
b
r63f-YY7Y.
b
		lQ	7 +r*   ZhatchingZdefault)r:   stylec            
      s   ^\         P                  R&   \         P                  ! 4       w  r\         P                  ! RRRRRR7      pVP	                  V4       \         P                  ! RRRRRRR	7      pVP	                  V4       \         P                  ! RRRRR
RR7      pVP	                  V4       \         P                  ! RRRRR
RRR7      pVP	                  V4       VP                  . RO. RO. RORRR7       VP                  . RO. RO. RORRRR	7       VP                  RR4       VP                  RR4       VP                  ^^R7       R# )   ztext.kerning_factor333333?ZxxzPatch
default color
filled)hatchr   z||rl   zPatch
explicit color
filled)r   	edgecolorr   FzPatch
default color
unfilled)r   fillr   zPatch
explicit color
unfilled)r   r   r   r   Z+zPath
default colorZC2zPath
explicit color皙?)ZhandlelengthZhandleheightN)r    r    )Q?r    )r    皙?)r   r   )r    g333333?r   )rj   rj   rj   )rM   rK   rM   )r   gQ?g)\(?g{Gz)	r   r   r   Z	Rectanglert   fill_betweenrR   rS   r   )r!   r"   patchrB   r(   test_hatchingr     s2    +,CLL&'llnGC MM&#s$ >@ELLMM)S#TT ?AELLMM(CDu @BELLMM+sCt%$( ACE LL OOL,%:  <OOO\=5K  M KKsKKsII11I-r*   c                  s    \         P                  ! 4       w  rVP                  \        ^
4      4      pV P	                  VR4      pVP                  4        VP	                  R4      pVP                  4        R# )r	   testN)r   r   r6   r\   r   Zremove)r!   r"   linesrg   r8   r(   test_legend_remover   $  sQ    llnGCGGE"IE
**UF
#CJJL
))F
CJJLr*   c                 s   \         P                  ! 4       w  r^p^p. ROp. ROpVP                  W#V^ ,          V^ ,          R7       VP                  W#V^,          V^,          R7       VP                  W#V^,          V^,          R7       VP                  RR7      pVP	                  4        Uu. uF  qwP                  4       NK  	  ppVP                   U	u. uF  qP                  4       NK  	  p
p	R# u upi u up	i )z6Check that the legend handles and labels are reversed.r>   TZreverseN)zFirst labelzSecond labelzThird label).Z,r<   )r   r   r6   r   	get_textsget_textlegend_handles
get_marker)r!   r"   r#   r$   r   markersrg   ZtZactual_labelshZactual_markerss              r(   &test_reverse_legend_handles_and_labelsr   /  s    llnGC	A	A;FGGGA'!*F1IG.GGA'!*F1IG.GGA'!*F1IG.
))D)
!C+.==?;?aZZ\?M;.1.@.@A.@lln.@NAN <As   .C2C7Zpng)Z
extensionsc                s2   V P                  4       pVP                  ^.RRR7       VP                  ^.RRR7       VP                  RR7       VP                  4       pVP                  ^.RRR7       VP                  ^.RRR7       VP                  4        R# )	z3Check that the rendered legend entries are reversedZroZfirstr>   ZbxZsecondTr   N)r   r6   r   )fig_testfig_refr"   s   && r(   test_reverse_legend_displayr   A  s     
			BGGQCWG%GGQCXG&IIdI				BGGQCXG&GGQCWG%IIKr*   c                   sb   a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tR tRtV tR# )TestLegendFunctioniO  c                s4   \         P                  ! \        ^
4      RR7      p\        P                  ! R4      ;_uu_ 4       p\         P
                  ! 4        RRR4       XP                  \         P                  ! 4       VR.4       R#   + '       g   i     L9; i)r	   hello worldr>   matplotlib.legend.LegendNr   r6   r\   r   r   r   assert_called_withgcaselfr   rX      &  r(   test_legend_no_argsZ&TestLegendFunction.test_legend_no_argsQ  sY    r-8ZZ233vJJL 4!!#'')U]OD 43s    BB	c                s6   \         P                  ! \        ^
4      4      p\        P                  ! R4      ;_uu_ 4       p\         P
                  ! VR.4       RRR4       XP                  \         P                  ! 4       VR.4       R#   + '       g   i     L9; i)r	   r   r   Nr   r   r   r(   %test_legend_positional_handles_labelsZ8TestLegendFunction.test_legend_positional_handles_labelsW  s^    r#ZZ233vJJu}o. 4!!#'')U]OD 43s   BB	c                s    \         P                  ! \        ^
4      4      p\        P                  ! \
        RR7      ;_uu_ 4        \         P                  ! V4       RRR4       R#   + '       g   i     R# ; i)r	   zbut found an ArtistZmatchN)r   r6   r\   pytestraises	TypeErrorr   )r   r   r0   r(   #test_legend_positional_handles_onlyZ6TestLegendFunction.test_legend_positional_handles_only]  sD    r#]]9,ABB JJu CBBBs   A%%A6	c                s8   \         P                  ! \        ^
4      RR7      p\        P                  ! R4      ;_uu_ 4       p\         P
                  ! R.4       RRR4       XP                  \         P                  ! 4       VR.4       R#   + '       g   i     L9; i)r	   r   r>   r   foobarNr   r   r   r(   "test_legend_positional_labels_onlyZ5TestLegendFunction.test_legend_positional_labels_onlyd  s^    r-8ZZ233vJJz" 4!!#'')UXJ? 43s    B		B	c                sB   \         P                  ! \        ^
4      RR7      p\        P                  ! R4      ;_uu_ 4       p\         P
                  ! VR.RR7       RRR4       XP                  \         P                  ! 4       VR.RR7       R#   + '       g   i     L;; i)r	   r   r>   r   r   r   r5   Nr   r   r   r(   test_legend_three_argsZ)TestLegendFunction.test_legend_three_argsj  sg    r-8ZZ233vJJuxjg6 4!!#'')UXJG!L 43s    BB	c                sR   \         P                  ! \        ^
4      RR7      p\        P                  ! R4      ;_uu_ 4       pVR.3Vn        \         P                  ! R^/R7       RRR4       XP                  \         P                  ! 4       .R^/4       R#   + '       g   i     L:; i)r	   r   r>   z,matplotlib.legend._get_legend_handles_labelsZ1)r   N)	r   r6   r\   r   r   Zreturn_valuer   r   r   )r   r   Zhandles_labelsr   r(   test_legend_handler_mapZ*TestLegendFunction.test_legend_handler_mapp  s|    r-8ZZ 5 6 69G*/-*@N'JJC8,6 	))3779+Qx@	6 6s    $BB&	c                s   \         P                  ! 4       w  r\        P                  ! ^ ^^4      pVP	                  W3RR7      w  pVP	                  V^V,          RR7      w  pVP	                  V^V,          RR7      w  p\
        P                  ! R4      ;_uu_ 4       pVP                  We.R7       RRR4       XP                  W&V.RR.4       R#   + '       g   i     L(; i)r    r#   r>   2xZ3xr   )r&   N	r   r   r   ry   r6   r   r   r   r   )r   r!   r"   r#   ln1ln2Zln3rX      &       r(   test_legend_kwargs_handles_onlyZ2TestLegendFunction.test_legend_kwargs_handles_onlyx  s    ,,.KK1b!wwq3w'wwq!A#Tw*wwq!A#Tw*ZZ233vIIsjI) 4!!"Cj4,? 43s   CC!	c                s   \         P                  ! 4       w  r\        P                  ! ^ ^^4      pVP	                  W34      w  pVP	                  V^V,          4      w  p\
        P                  ! R4      ;_uu_ 4       pVP                  RR.R7       RRR4       XP                  W$V.RR.4       R#   + '       g   i     L(; i)r    r   r#   r   r   Nr   )r   r!   r"   r#   r   r   rX      &      r(   test_legend_kwargs_labels_onlyZ1TestLegendFunction.test_legend_kwargs_labels_only  s    ,,.KK1b!wwq}wwq!A#ZZ233vIIc4[I) 4!!"Cj3+> 43s   <B11C	c                s   \         P                  ! 4       w  r\        P                  ! ^ ^\        P                  ,          R4      pVP                  V\        P                  ! V4      RR7      w  pVP                  V\        P                  ! V4      RR7      w  p\        P                  ! R4      ;_uu_ 4       pVP                  RWT3R7       RRR4       XP                  W%V3R4       R#   + '       g   i     L&; i)	r       sinr>   cosr   )r   r&   Nr
   r   )r   r   r   ry   pir6   r   r   r   r   r   r   )r   r!   r"   thlnslncrX   r   r(   !test_legend_kwargs_handles_labelsZ4TestLegendFunction.test_legend_kwargs_handles_labels  s    ,,.[[AbeeGT*wwr266":Uw3wwr266":Uw3ZZ233vIIZ#I< 4 	!!"Cj*= 43s   7C**C:	c                s   \         P                  ! 4       w  r\        P                  ! ^ ^\        P                  ,          R4      pVP                  V\        P                  ! V4      RR7      w  pVP                  V\        P                  ! V4      RR7      w  p\        P                  ! \        4      ;_uu_ 4       pVP                  WT3RR7       RRR4       R#   + '       g   i     R# ; i)r    r   r   r>   r   r   Nr   )r   r   r   ry   r   r6   r   r   r   warnsDeprecationWarningr   )r   r!   r"   r   r   r   recordr   r(   test_warn_mixed_args_and_kwargsZ2TestLegendFunction.test_warn_mixed_args_and_kwargs  s    ,,.[[AbeeGT*wwr266":Uw3wwr266":Uw3\\,--IIsjI4 .---s   ;CC+	c                st   ^ RI Hp V! ^o4      pVP                  4       pVP                  . RO. RORR7      w  pVP                  . RO. RORR7      w  p\        P
                  ! R4      ;_uu_ 4       p\        P                  ! 4        RRR4       XP                  W$V.RR.4       R#   + '       g   i     L(; i)	r    )host_subplotZDensityr>   ZTemperaturer   Nr    r   r   )r    r   r   )	Zmpl_toolkits.axes_grid1r   Ztwinxr6   r   r   r   r   r   )r   r   ZhostZparr   r   rX   r   r(   test_parasiteZ TestLegendFunction.test_parasite  s    8C jjlii	9Ii>hhy)=hAZZ233vJJL 4!!$R9m2LM 43s   1B''B7	r-   N)__name__
__module____qualname____firstlineno__r   r   r   r   r   r   r   r   r   r   r   __static_attributes____classdictcell__Z__classdict__   @r(   r   r   O  sI     EE@MA@?>
N Nr*   r   c                   sD   a  ] tR tRt o R tR tR tR tR tR t	Rt
V tR	# )
TestLegendFigureFunctioni  c                s@   \         P                  ! 4       w  rVP                  \        ^
4      4      p\        P
                  ! R4      ;_uu_ 4       pVP                  VR.4       RRR4       XP                  WR.VP                  R7       R#   + '       g   i     L1; i)r	   r   r   Nbbox_transform	r   r   r6   r\   r   r   r   r   transFigurer   r!   r"   r   rX      &    r(   test_legend_handle_labelZ1TestLegendFigureFunction.test_legend_handle_label  sr    ,,.b	"ZZ233vJJu}o. 4!!#}o14 	" 	B 43s   BB	c                s>   \         P                  ! 4       w  rVP                  \        ^
4      RR7      p\        P
                  ! R4      ;_uu_ 4       pVP                  4        RRR4       XP                  WR.VP                  R7       R#   + '       g   i     L1; i)r	   r   r>   r   Nr   r   r   r   r(   r   Z,TestLegendFigureFunction.test_legend_no_args  so    ,,.b	7ZZ233vJJL 4!!#}o14 	" 	B 43s   BB	c                s>   \         P                  ! 4       w  rVP                  \        ^
4      4      p\        P
                  ! R4      ;_uu_ 4       pVP                  R.4       RRR4       XP                  WR.VP                  R7       R#   + '       g   i     L1; i)r	   r   r   Nr   r   r   r   r(   test_legend_label_argZ.TestLegendFigureFunction.test_legend_label_arg  sp    ,,.b	"ZZ233vJJz" 4!!#xj14 	" 	B 43s   BB	c           	     s   \         P                  ! 4       w  rVP                  \        ^
4      4      p\        P
                  ! \        RR7      ;_uu_ 4        VP                  VR.R4       RRR4       \        P
                  ! \        RR7      ;_uu_ 4        VP                  VR.RRR7       RRR4       R#   + '       g   i     LU; i  + '       g   i     R# ; i)r	   z0-2r   r   r   Nleftr5   )r   r   r6   r\   r   r   r   r   )r   r!   r"   r      &   r(   test_legend_label_three_argsZ5TestLegendFigureFunction.test_legend_label_three_args  s    ,,.b	"]]9E22JJuxj'2 3]]9E22JJuxj'vJ> 32 32222s   B8C8C	C	c                s   \         P                  ! ^^4      w  rV^ ,          P                  \        ^
4      4      pV^,          P                  \        P
                  ! ^
4      R,          4      p\        P                  ! R4      ;_uu_ 4       pVP                  RRW43R7       RRR4       XP                  WV3RRVP                  R7       R#   + '       g   i     L3; i)r          @r   r   )r   r   r&   N)r   r   r   )r   r   r6   r\   r   rA   r   r   r   r   r   )r   r!   re   r   lines2rX      &     r(   test_legend_kw_argsZ,TestLegendFigureFunction.test_legend_kw_args  s    <<1%AE"I&QRYYr]R/0ZZ233vJJ7:JO 4!!*'?? 	" 	, 43s   CC	c                s   \         P                  ! ^^4      w  rV^ ,          P                  \        ^
4      4      pV^,          P                  \        P
                  ! ^
4      R,          4      p\        P                  ! \        4      ;_uu_ 4       pVP                  W43RR7       RRR4       R#   + '       g   i     R# ; i)r   r  r   Nr   )
r   r   r6   r\   r   rA   r   r   r   r   )r   r!   re   r   r  r   r  r(   test_warn_args_kwargsZ.TestLegendFigureFunction.test_warn_args_kwargs  s|    <<1%AE"I&QRYYr]R/0\\,--JJzJ: .---s   B//C 	r-   N)r   r   r   r   r   r   r   r  r  r  r   r   r   r   r(   r   r     s+     BBB?,	 	r*   r   c                  sJ   R U u. uF  p RV ,           NK  	  pp TR U u. uF  p RV ,           NK  	  up ,          pTR U u. uF  p RV ,           NK  	  up ,          pTR U u. uF  p RV ,           NK  	  up ,          p. ROp. ROp. ROp. ROpW"VW3VWDVWUV.p. RO. RO. RO. RO. RO. RO. RO. RO. RO. RO. RO. RO.p\        V4       F  w  r\        V	4       \        P                  ! R^dR7      w  rVP	                  \        ^
4      RR7       V
P                  R	V	,           R
7      pV
P                  4        \        VP                  4       P                  Wh,          ^R7       \        VP                  4       P                  Wx,          ^R7       K  	  R# u up i u up i u up i u up i )r  zupper zlower zleft zright T)Zconstrained_layoutdpiZBoo1r>   zoutside r5   )ZrtolN)r  rq   r   )Zlowerrq   Zupper)QnX4@Qn;@l@gE@)r
  g Q@r  lf@)gLNb@r  r  r  )r
  r  gE@r  )      $@     X@     `@     p@)     (u@r       |@r  )  r       @r  )r  r  r       F@)r  r  r  r  )     ؄@r  r  r  )r       q@r       s@)r  r  r  r  )r  r  r  r  )r  r  r  r  )Z	enumerateZprintr   r   r6   r\   r   Zdraw_without_renderingr   r`   Zextents)ZposZtodosZupperextZlowerextZleftextZrightextZaxbbZlegbbZnnZtodor!   re   rg   s                r(   test_figure_legend_outsider    s   'BC'BX^^'BEC	(CD(Chnn(CDDE	'CD'Cgmm'CDDE	(DE(Dhnn(DEEE8H8H7G8Hg*D
 %'%#&$"&$"'%'E e$d<<4SAr&)jjZ$.j/""$--/77q	*--/77		+ %7 DDDEs   FFFF zlegend_stackplot.pnggX9v?)r}   c                 sJ   \         P                  ! 4       w  r\        P                  ! ^ ^
^
4      pRV,          pRV,          ^,           pRV,          ^,           pVP	                  W#WE. ROR7       VP                  R	4       VP                  R
4       VP                  RR7       R# )z/Test legend for PolyCollection using stackplot.rK   r  g      @r   r@   r5   N)y1y2y3)r    r	   )r    iF   )r   r   r   ry   Z	stackplotrR   rS   r   )r!   r"   r#   r  r  r  rh   r(   test_legend_stackplotr    s    
 llnGC
Ar2A	qB	q1B	q1BLL'9L:KKKKII&Ir*   c                  s    \         P                  ! 4       w  r\         P                  ! 4       w  r#VP                  \        ^4      \        ^4      4      pVP	                  VR4       R# )r   fooN)r   r   rF   r\   r   )r!   r"   Zfig2Zax2ZbrsrG   r(   test_cross_figure_patch_legendr      sB    llnGCID
&&q58
$CKKUr*   c                  s   \         P                  ! 4       w  rVP                  \        P                  .\        P                  .R RR^R7      pVP                  V.R.4       \         P                  ! 4       w  rR Fc  pRp\        P                  P                  ^V4      w  rVR\        P                  P                  V4      ,          pVP                  WVW7VRRR7       Ke  	  VP                  4        VP                  R	4       R
# )r<   r   )marker	facecolorr   sr   i  g      i@r   none)r   r#  r   alpha
edgecolorsTN)redZgreenZblue)	r   r   r   r   Znanr   r   randZgrid)r!   r"   r   r%   nr#   r$   Zscaler   r(   test_nanscatterr*  (  s    llnGC


BFF8bffXc C1 	 	6A IIqcI;llnGC)yy~~a#		q))


15 	 	1	 * IIKGGDMr*   c                  s   \         P                  ! 4       w  rVP                  R RRRRR7       VP                  RR RRRR7       VP                  4        \        P
                  ! V.4      w  r#\         P                  ! 4       w  rVP                  R RRRRR7       VP                  RR RRRR7       VP                  4        \        P
                  ! V.4      w  r#R	# )
rJ   rK   kr<   r   )r%   r!  r   r   r   vN)r   r   r   r   mlegendZ_get_legend_handles_labels)r!   r"   ZhandZlabr8   r(   test_legend_repeatcheckokr.  <  s    llnGCJJsCs3fJ=JJsCs3fJ=IIK22B48IDllnGCJJsCs3fJ=JJsCs3fJ=IIK22B48ID#r*   znot_covering_scatter.pngc                  s<   . ROp \        ^4       F$  p\        P                  ! V.V.W,          R7       K&  	  \        P                  ! . RORR7       \        P                  ! 4       P                  RR4       \        P                  ! 4       P                  RR4       R# )	r   )r%   r@   r5   皙@N)r   r   r   )r  r  r  g      )r\   r   r   r   r   rR   rS   )r    r)  r{   r(   test_not_covering_scatterr0  K  sh    F1XQC!FI.  JJ$&1GGItS!GGItS!r*   z"not_covering_scatter_transform.pngc                  s^   \         P                  ! 4       P                  R^4      p \        P                  ! ^ ^R4      p\
        P                  ! W4       \
        P                  ! ^.^
.V \
        P                  ! 4       P                  ,           R7       \
        P                  ! RR.RR7       R# )	i   i  )Z	transformr  rF   r@   r5   Ni)mtransformsZAffine2DZ	translater   ry   r   r6   r   r   Z	transDatar   )Zoffsetr#   r{   r(   #test_not_covering_scatter_transformr2  W  ss     !!#--c26F
Ar4 AHHQNKKrdfswwy/B/B&BCJJu~6*r*   c                  s   RR.RR..p RR.RR..RR.RR...pRR.RR..RR.RR...p\         P                  ! V R^R	7      p\         P                  ! VR
R7      p\         P                  ! VRRR	7      p\        P                  ! 4       w  rgVP	                  V4       VP	                  V4       VP	                  V4       VP                  W4V.. RO4      pVP                  w  rp\        W4V3WV34       F  w  rK  	  R# )r    r   333333?rk   gffffff?rj   r   rN   z--)
linestylesr   z-.)r4  Z:N)r    r   )r   r   )r   r3  )rk   rk   )Zline1Zline2zline 3)mcollectionsZLineCollectionr   r   Zadd_collectionr   r   r   )Zlines1r  Zlines3Zlc1Zlc2Zlc3r!   r"   rg   Zh1Zh2Zh3Zohlhs                 r(   !test_linecollection_scaled_dashesr7  c  s    8X"67FRy2r(#r2hR%9:FRy2r(#r2hR%9:F

%
%f!
DC

%
%f
>C

%
%f
DCllnGCccc
))SsO%A
BC##JBBso|4B4r*   c                 s    \         P                  ! 4       w  rVP                  \        ^4      RR7       VP	                  RR7       R# )z(Test legend handler with numpoints <= 1.r   r>   r   rw   Nr   r   r6   r\   r   rz   r{   r(   test_handler_numpointsr:  w  s3     llnGCGGE!HFG#IIIr*   c                 sp   \         P                  ! 4       w  rVP                  ^ .RR7       VP                  ^ ^ RRR7       \        P
                  ! \        4      ;_uu_ 4       pVP                  4        RRR4       \         P                  ! 4       w  r1VP                  \        P                  P                  ^ ^R4      4       \        P                  ! 4       ;_uu_ 4        \        P                  ! R4       VP                  4        RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)	z2Test that Text artists with labels raise a warning	mock datar>   textr   )r#   r$   r#  r   NZerror)r	   r	   )r   r   r6   r<  r   r   UserWarningr   Z
pcolormeshr   r   ZuniformwarningsZcatch_warningsZsimplefilterr   )r!   r"   r   fr8   r(   test_text_nohandler_warningr@    s    llnGCGGQC{G#GGa1gG.	k	"	"f
		 
#
 LLNEAMM"))##Aq(34		 	 	"	"g&
$$& 
#	" 
#	" 
#	"	"s   #D 'D$D!	$D5	c                 sb    \         P                  ! . . RR7       \         P                  ! 4        R# )z1Test legend when bar chart is empty with a label.r   r>   N)r   rF   r   r-   r*   r(    test_empty_bar_chart_with_legendrA    s     GGB&!JJLr*   zshadow_argument_types.pngZmpl20gy&1?)r:   r   r}   c                  s   \         P                  ! 4       w  rVP                  . RORR7       VP                  RRR7      VP                  RRR7      VP                  RR	R
RR/R7      VP                  RR	RRR/R7      VP                  RR	RR^
/R7      3pV F  pVP	                  V4       K  	  VP                  RR7       R# )r   r   r>   r4   Tr   r   upper rightFr   r%   r'  r%  rN   center rightZoyr   ztab:cyanZoxlower rightr5   Nr   )rN   rk   r   i)r   r   r6   r   r   )r!   r"   ZlegsZlr8   r(   test_shadow_argument_typesrF    s     llnGCGGIVG$ II,tI4II-I6II-%ugs;  =II.%bA  CII,%z4<  >D 
a II-I r*   c                  s   \         P                  ! 4       w  rVP                  . R	ORR7       \        P                  ! \
        RR7      ;_uu_ 4        VP                  RRR7       RRR4       R#   + '       g   i     R# ; i)
r   r   r>   zdict or boolr   r4   ZaardvarkrB  Nr   )r   r   r6   r   r   
ValueErrorr   rz   r{   r(   test_shadow_invalid_argumentrH    sQ     llnGCGGIVG$	z	8	8
		l:	6 
9	8	8	8s   A//B 	c                  s    \         P                  ! 4       w  rVP                  \        ^d4      RR7       VP	                  RRR7      pR# )d   r   r>   TZw)r   r"  Nr9  r   rB   r(   test_shadow_framealpharJ    s7     llnGCGGE#JfG%
))43)
/Cr*   c                  s    \         P                  ! 4       w  rVP                  \        ^
4      RR7       VP	                  4       pR# )r	   r;  r>   Nr9  r   rB   r(   test_legend_title_emptyrK    s0     llnGCGGE"I[G)
))+Cr*   c                  s   \         P                  ! ^dR7      w  rVP                  \        ^
4      RR7       VP	                  4       pVP                  V P                  P                  4       4      P                  p\         P                  ! ^R7      w  rVP                  \        ^
4      RR7       VP	                  4       pVP                  V P                  P                  4       4      P                  pR# rI  )r	  Aardvarkr>   N)	r   r   r6   r\   r   r`   r]   Zget_rendererZx0)r!   r"   rg   Zx01Zx02rG   r(    test_legend_proper_window_extentrN    s    lls#GCGGE"IZG(
))+C




 7 7 9
:
=
=Clls#GCGGE"IZG(
))+C




 7 7 9
:
=
=Cr*   c                  s$   \         P                  ! ^dR7      w  rVP                  \        ^
4      RR7       VP	                  4       pV P	                  4       pV P
                  P                  4        VP                  4        VP                  4        R# rL  )r   r   r6   r\   r   r]   r^   r`   )r!   r"   rg   leg2r8   r(   "test_window_extent_cached_rendererrP    sb    lls#GCGGE"IZG(
))+C::<DJJOOr*   c            
      s   \         P                  ! \        ^
4      RR7       \        P                  ! \
        4      ;_uu_ 4        \         P                  ! R^RRR^/R7       RRR4       \         P                  ! R\        R^R	7      R
7      p \         P                  ! ^^RR7      w  rVP                  pV^ ,          P                  \        ^
4      RR7       V^ ,          P                  R^R7      pV^,          P                  \        ^
4      RR7       V^,          P                  RRRR^/R
7      pV^,          P                  \        ^
4      RR7       R\        P                  R&   V^,          P                  RRR/R
7      pV^,          P                  \        ^
4      RR7       V^,          P                  RR7      pV^,          P                  \        ^
4      RR7       ^\        P                  R&   V^,          P                  RRR/R
7      pV^,          P                  \        ^
4      RR7       V^,          P                  RR7      pR#   + '       g   i     EL; i)r	   r;  r>   rM  familyserifsize)r   title_fontsizetitle_fontpropertiesN)rQ  rS  )r   rU  )rW   )r   rT  zlegend.title_fontsizer   )r	   r   )r   r6   r\   r   r   rG  r   r   r   rZ   r   r   )	rg   r!   ZaxesZleg0Zleg1rO  Zleg3Zleg4Zleg5	            r(   #test_legend_title_fontprop_fontsizerX    s   HHU2Yk*	z	"	"

B)17FB(G	I 
# **:N.5B=@ AC Q73IC99DGLLr+L.7>>
2>>DGLLr+L.7>>
08'62/N  PD 	GLLr+L.,0CLL()7>>
08'/B  DD 	GLLr+L.7>>
>+DGLLr+L.,.CLL()7>>
08'/B  DD 	GLLr+L.7>>
>+D? 
#	"	"s   II!		alignmentc                 s    \         P                  ! 4       w  rVP                  \        ^
4      RR7       VP	                  RV R7      pR# )r	   r   r>   rM  )r   rY  Nr9  rY  r!   r"   rg   r  r(   test_legend_alignmentr[    s5    llnGCGGE"IVG$
))*	)
:Cr*   r   c                     \         P                  ! 4       w  rVP                  \        ^
4      RR7       VP	                  4       pVP                  V 4       R# r	   r   r>   N)r   r   r6   r\   r   set_locr   r!   r"   rg   r  r(   test_ax_legend_set_locr`    s:    llnGCGGE"IVG$
))+CKKr*   c                 s   \         P                  ! 4       w  rVP                  \        ^
4      RR7       VP	                  4       pVP                  V 4       V P                  R4      '       d   V P                  4       ^,          p R# T p R# )r	   r   r>   ZoutsideN)r   r   r6   r\   r   r^  Z
startswithZsplitr_  r  r(   test_fig_legend_set_locra    s[    llnGCGGE"IVG$
**,CKKNN955#))+a.C3Cr*   c                 r\  r]  )r   r   r6   r\   r   Zset_alignmentrZ  r  r(   test_legend_set_alignmentrb  (  s<    llnGCGGE"IVG$
))+Ci r*   r%   c                 s   \         P                  ! 4       w  rVP                  \        P                  ! ^
4      \        P                  ! ^
4      ^,          RR7       VP                  \        P                  ! ^
4      \        P                  ! ^
4      ^,          RR7       VP                  \        P                  ! ^
4      \        P                  ! ^
4      ^,          RR7       VP                  V R7      pVP                  4        F  pK  	  R# )r	   #1r>   #2#3Z
labelcolorN)r   r   r6   r   rA   r   r   r%   r!   r"   rg   r<  r   r(   test_legend_labelcolor_singlerh  2  s     llnGCGGBIIbM299R=?$G7GGBIIbM299R=?$G7GGBIIbM299R=?$G7
))u)
%Cr*   c                  s8   \         P                  ! 4       w  rVP                  \        P                  ! ^
4      \        P                  ! ^
4      ^,          RR7       VP                  \        P                  ! ^
4      \        P                  ! ^
4      ^,          RR7       VP                  \        P                  ! ^
4      \        P                  ! ^
4      ^,          RR7       VP                  . ROR7      p\        VP                  4       . RO4       F  w  r4K  	  R# )r	   rc  r>   rd  re  rf  Nr   r   r   r   r   r6   r   rA   r   r   r   r!   r"   rg   r<  r%   rG   r(   test_legend_labelcolor_listrl  ?  s    llnGCGGBIIbM299R=?$G7GGBIIbM299R=?$G7GGBIIbM299R=?$G7
)))
/C3==?O<e<r*   c                  :   \         P                  ! 4       w  rVP                  \        P                  ! ^
4      \        P                  ! ^
4      ^,          RRR7       VP                  \        P                  ! ^
4      \        P                  ! ^
4      ^,          RRR7       VP                  \        P                  ! ^
4      \        P                  ! ^
4      ^,          RRR7       VP                  RR	7      p\        VP                  4       . RO4       F  w  r4K  	  R
# )r	   rc  r   r   r%   rd  r   re  r   	linecolorrf  Nri  rj  rk  rG   r(    test_legend_labelcolor_linecolorrp  K  s    llnGCGGBIIbM299R=?$cGBGGBIIbM299R=?$cGBGGBIIbM299R=?$cGB
)){)
+C3==?O<e<r*   c                  rm  )r	   rc  r   r   rd  r   re  r   ro  rf  Nri  r   r   r   r   rA   r   r   r   rk  rG   r(   /test_legend_pathcollection_labelcolor_linecolorrr  W  s    llnGCJJryy}biimAoTSJAJJryy}biimAoTSJAJJryy}biimAoTSJA
)){)
+C3==?O<e<r*   c                  s4   \         P                  ! 4       w  r\        P                  ! . RO^,          4      pVP	                  \        P
                  ! ^
4      \        P
                  ! ^
4      RVR7       VP                  RR7      pVP                  4       w  pR# )r   rc  r   ro  rf  Nr   r   r   r   rD   )r   r   r   rs   r   rA   r   r   )r!   r"   r    rg   r<  rG   r(   8test_legend_pathcollection_labelcolor_linecolor_iterablert  c  sf     llnGCXX/!34FJJryy}biim46JB
)){)
+CMMOEDr*   c                  s   \         P                  ! 4       w  rVP                  \        P                  ! ^
4      \        P                  ! ^
4      \        P                  ! ^
4      RR7       VP                  RR7      pVP                  4       w  pR# )r	   rc  )r   r   ro  rf  N)r   r   r   r   rA   r   r   )r!   r"   rg   r<  r8   r(   4test_legend_pathcollection_labelcolor_linecolor_cmapru  o  sZ     llnGCJJryy}biimryy}DJI
)){)
+CMMOEDr*   c                  rm  )r	   rc  r   r   markeredgecolorrd  r   re  r   rw  rf  Nri  rj  rk  rG   r(   &test_legend_labelcolor_markeredgecolorrx  z      llnGCGGBIIbM299R=?$GLGGBIIbM299R=?$GLGGBIIbM299R=?$GL
))0)
1C3==?O<e<r*   c                  rm  )r	   rc  r   r   r   rd  r   re  r   rw  rf  Nri  rq  rk  rG   r(   5test_legend_pathcollection_labelcolor_markeredgecolorr{        llnGCJJryy}biimAoTSJIJJryy}biimAoTSJIJJryy}biimAoTSJI
))0)
1C3==?O<e<r*   c                  X   \         P                  ! 4       w  r\        P                  ! . RO^,          4      pVP	                  \        P
                  ! ^
4      \        P
                  ! ^
4      RVR7       VP                  RR7      p\        VP                  4       R.4       F  w  rEK  	  R# )r   rc  rz  rw  rf  r+  Nrs  	r   r   r   rs   r   rA   r   r   r   r!   r"   r    rg   r<  r%   rh   r(   >test_legend_pathcollection_labelcolor_markeredgecolor_iterabler    u     llnGCXX/!34FJJryy}biim46JJ
))0)
1C3==?SE2e2r*   c            	      s   \         P                  ! 4       w  r\        P                  P	                  \
        P                  P                  ^
4      4      pVP                  \
        P                  ! ^
4      \
        P                  ! ^
4      R\
        P                  ! ^
4      VRR7       VP                  RR7      p\        VP                  4       R.4       F  w  rEK  	  R# )r	   rc  ZReds)r   r   r   Zcmaprw  rf  r+  Nr   r   r   ZcmZviridisr   r   r(  r   rA   r   r   r   )r!   r"   r&  rg   r<  r%   rh   r(   :test_legend_pathcollection_labelcolor_markeredgecolor_cmapr    s     llnGC		r 23JJJ
		"
		"
))B-   ))0)
1C3==?SE2e2r*   c                  rm  )r	   rc  r   r   markerfacecolorrd  r   re  r   r  rf  Nri  rj  rk  rG   r(   &test_legend_labelcolor_markerfacecolorr    ry  r*   c                  rm  )r	   rc  r   r   r"  rd  r   re  r   r  rf  Nri  rq  rk  rG   r(   5test_legend_pathcollection_labelcolor_markerfacecolorr    r|  r*   c                  r}  )r   rc  r  r  rf  r+  Nrs  r~  r  rh   r(   >test_legend_pathcollection_labelcolor_markerfacecolor_iterabler    r  r*   c                  s   \         P                  ! 4       w  r\        P                  P	                  \
        P                  P                  ^
4      4      pVP                  \
        P                  ! ^
4      \
        P                  ! ^
4      RVR7       VP                  RR7      p\        VP                  4       R.4       F  w  rEK  	  R# )r	   rc  r   r  rf  r+  Nr  r  rh   r(   8test_legend_pathcollection_labelcolor_markfacecolor_cmapr    s     llnGCVV^^BIINN2./FJJ
		"
		"
	   ))0)
1C3==?SE2e2r*   c                 s:   \         P                  ! 4       w  rVP                  \        P                  ! ^
4      \        P                  ! ^
4      ^,          RR7       VP                  \        P                  ! ^
4      \        P                  ! ^
4      ^,          RR7       VP                  \        P                  ! ^
4      \        P                  ! ^
4      ^,          RR7       V \
        P                  R&   VP                  4       pVP                  4        F  pK  	  R# )r	   rc  r>   rd  re  legend.labelcolorN)	r   r   r6   r   rA   r   r   r   r   rg  r   r(   %test_legend_labelcolor_rcparam_singler    s     llnGCGGBIIbM299R=?$G7GGBIIbM299R=?$G7GGBIIbM299R=?$G7(-CLL$%
))+Cr*   c                  \   \         P                  ! 4       w  rVP                  \        P                  ! ^
4      \        P                  ! ^
4      ^,          RRR7       VP                  \        P                  ! ^
4      \        P                  ! ^
4      ^,          RRR7       VP                  \        P                  ! ^
4      \        P                  ! ^
4      ^,          RRR7       R\
        P                  R	&   VP                  4       p\        VP                  4       . RO4       F  w  r4K  	  R
# )r	   rc  r   rn  rd  r   re  r   ro  r  Nri  
r   r   r6   r   rA   r   r   r   r   r   rk  rG   r(   (test_legend_labelcolor_rcparam_linecolorr    s    llnGCGGBIIbM299R=?$cGBGGBIIbM299R=?$cGBGGBIIbM299R=?$cGB(3CLL$%
))+C3==?O<e<r*   c                  r  )r	   rc  r   rv  rd  r   re  r   rw  r  Nri  r  rk  rG   r(   .test_legend_labelcolor_rcparam_markeredgecolorr        llnGCGGBIIbM299R=?$GLGGBIIbM299R=?$GLGGBIIbM299R=?$GL(9CLL$%
))+C3==?O<e<r*   c                  r  )r	   rc  r   rv  rd  r   re  r   Zmecr  Nri  r  rk  rG   r(   4test_legend_labelcolor_rcparam_markeredgecolor_shortr        llnGCGGBIIbM299R=?$GLGGBIIbM299R=?$GLGGBIIbM299R=?$GL(-CLL$%
))+C3==?O<e<r*   c                  r  )r	   rc  r   r  rd  r   re  r   r  r  Nri  r  rk  rG   r(   .test_legend_labelcolor_rcparam_markerfacecolorr    r  r*   c                  r  )r	   rc  r   r  rd  r   re  r   Zmfcr  Nri  r  rk  rG   r(   4test_legend_labelcolor_rcparam_markerfacecolor_shortr  (  r  r*   z4ignore:No artists with labels found to put in legendc                  st    \         P                  ! 4       p V P                  R 4       V P                  R4       R# )TFN)r   r   Zset_draggabler   r   r(   test_get_set_draggabler  5  s)    ZZ\F

r*   	draggablec                 s    \         P                  ! 4       w  rVP                  \        ^
4      RR7       VP	                  V R7      pR# )r	   Zshabnamsr>   )r  Nr9  )r  r!   r"   rg   r  r(   test_legend_draggabler  ?  s3    llnGCGGE"IZG(
))i)
(Cr*   c                  s    \         P                  ! . RORRRR7      w  rp\         P                  ! 4       pVP                   F  pVP	                  R4       K  	  R# )r   g      ?datar'  )r%  r   r%   rK   Nr   )r   r[   r   r   	set_alpha)r#   r)  Zhhr   r6  rG   r(   test_alpha_handlesr  G  sA    xx	V5IHA"ZZ\F##
S $r*   c                 s&   R \         P                  R&   R\         P                  R&   R\         P                  R&   \        P                  ! 4       w  rVP	                  ^ ^ RR7       VP                  RR	7       VP                  P                  4        R
# )rR  zfont.familyzComputer Modernz
font.serifTztext.usetexZinputr>   r   rV  N)r   r   r   r   r6   r   r]   r^   )Zcaplogr!   r"   r   r(   test_usetex_no_warnr  P  sg    ")CLL!2CLL"&CLLllnGCGGAqG IIKI JJOOr*   c                 s.  a \         P                  ! ^ RR7      oV P                  \        RV3R l4       \        P
                  ! 4       w  rVP                  P                  4        . ROp. ROpVP                  W4RRR7       \        RR	/4      ;_uu_ 4        VP                  4       pR
R
R
4       \        P                  ! \        RR7      ;_uu_ 4       pVP                  X4       R
R
R
4       R
#   + '       g   i     LP; i  + '       g   i     R
# ; i)r          ?rY   perf_counterc                     < \        S 4      # r,   Znextcounter   r(   <lambda>Z-test_warn_big_data_best_loc.<locals>.<lambda>a  	    d7mr*   rI   r/   r>   z
legend.locr@   NzGCreating legend with loc="best" can be slow with large amounts of data.r   rL   rO   )	itertoolscountsetattrtimer   r   r]   r^   r6   r   r   r   r   r=  draw_artist)monkeypatchr!   r"   r#   r$   r   Zrecordsr  s   &      @r(   test_warn_big_data_best_locr  ^  s    ooac*Gn.CDllnGCJJOO 	'A*AGGA$fG%	\6*	+	+ 
,	k)
* 
*-4
* 
* 
,	+
* 
* 
*s   C0D0D 	D	c                 sL  a \         P                  ! ^ RR7      oV P                  \        RV3R l4       \        P
                  ! 4       w  rVP                  P                  4        . R
Op. ROpVP                  W4RRR7       VP                  R4      pVP                  V4       R	# )r    r  r  r  c                  r  r,   r  r  r  r(   r  Z:test_no_warn_big_data_when_loc_specified.<locals>.<lambda>y  r  r*   rI   r/   r>   r@   NrL   rO   )r  r  r  r  r   r   r]   r^   r6   r   r  )r  r!   r"   r#   r$   r   r  s   &     @r(   (test_no_warn_big_data_when_loc_specifiedr  v  sy    ooac*Gn.CDllnGCJJOO 	'A*AGGA$fG%YYvFOOFr*   label_arraylowhighc                     . ROp^^.^^.^^	..p\         P                  ! 4       w  r4VP                  WV R7       VP                  4       pVP	                  4        Uu. uF  qfP                  4       NK  	  ppR# u upi r   r>   Nr   r   r   r6   r   r   r   )r  r#   r$   r!   r"   rg   entrylegend_textsr   r(   'test_plot_multiple_input_multiple_labelr    ss     	A
Q
Q
Q	A llnGCGGAG$
))+C25--/B/NN$/LBLB   A8r   r   c                 r  r  r  )r   r#   r$   r!   r"   rg   r  r  r   r(   %test_plot_multiple_input_single_labelr    ss     	A
Q
Q
Q	A llnGCGGAG
))+C25--/B/NN$/LBLBr  c                 s   . ROp. ROp\         P                  ! 4       w  r4\        P                  ! \        P
                  RR7      ;_uu_ 4        VP                  WV R7       RRR4       VP                  4       pR#   + '       g   i     L"; i)r   z$Passing label as a length 2 sequencer   r>   Nr   )r   r   r   )r   r   r   r   r   ZMatplotlibDeprecationWarningr6   r   )r  r#   r$   r!   r"   rg   r  r(   %test_plot_single_input_multiple_labelr    si     	AAllnGC	c66B
D 
D
K(
D ))+C
D 
Ds   A<<B	c                  sh    \         P                  ! 4       w  rVP                  ^ .^..R.R7      w  pR# )r    ZAr>   N)r   r   r6   )r!   r"   r/   rB   r(   !test_plot_single_input_list_labelr    s-    llnGCGGaS1#JseG,EDr*   c                  s    \         P                  ! \        4      ;_uu_ 4        . ROp ^^.^^.^^	..p. ROp\        P                  ! 4       w  r4VP                  WVR7       RRR4       R#   + '       g   i     R# ; i)r   r>   Nr   )r  r  Zmedium)r   r   rG  r   r   r6   )r#   r$   r   r!   r"   rG   r(   3test_plot_multiple_label_incorrect_length_exceptionr    sg     
z	"	"VVV *,,.
E" 
#	"	"	"s   >A++A<	c            	      s    \         P                  ! 4       w  rVP                  . RO. RO. RORRRR7       VP                  4        R# )	r    r   ZfaceZFill)r"  r   r   Nr   r   r   )r   r   r   r   rz   r{   r(   test_legend_face_edgecolorr    s7    llnGCOOIy)!V6  CIIKr*   c                  s    \         P                  ! 4       w  rVP                  ^^.^^.RR7       VP                  4       pR# )r   r/   r>   N)r   r   r6   r   r   rB   r(   test_legend_text_axesr    s4    llnGCGGQFQF&G)
))+Cr*   c                  s    \         P                  ! 4       w  rVP                  ^ ^.^ ^.RR7       \        P                  ! ^ .^ .RR7      .pVP                  VR.^R7      pR# )r    r,  )r!  rM  r8  N)r   r   r   mlinesLine2Dr   )r!   r"   r&   rg   r8   r(   test_handlerline2dr    sX    llnGCJJ1v1vcJ*}}aS1#c23G
))Gj\Q)
7Cr*   c                  s    \         P                  ! 4       P                  4       p V P                  4       pVP	                  ^ ^.^ ^.RR7       V P                  4       pR# )r    r/   r>   N)r   rx   Z
subfiguresr   r6   r   )Zsubfigr"   rg   rB   r(   test_subfigure_legendr    sG    ZZ\$$&F		BGGQFQF&G)
--/Cr*   c                  s    \         P                  ! ^ ^.^^.RRR7      p \         P                  ! 4       P                  4       ^ ,          pVP	                  R4       R# )r    z#123456r   )r%   r   r   N)r   r   r   Zget_patchesr  )Zpcr   r{   r(   -test_setting_alpha_keeps_polycollection_colorr    sE    			1a&1a&		IBJJL$$&q)E	OOCr*   c            
      s   . ROp \         P                  ! 4       w  rV  Uu. uF  p\        P                  ! ^ .^ .RVR7      NK!  	  pp. ROpV Uu. uF  qfP	                  4       NK  	  ppVP                  WE4      pVP                  4        Uu. uF  qfP	                  4       NK  	  p	pVP                  4        U
u. uF  qP                  4       NK  	  pp
R# u upi u upi u upi u up
i )r   ZNone)Zlsr!  N)r   Z*r,  )r  rF   Zxyzzy)	r   r   r  r  r   r   r7   r   r   )Z_markersr!   r"   markr   r   r/   r   r   Znew_markersr<  Z
new_labelsr'   r(   test_legend_markers_from_line2dr    s    HllnGC!#! ]]A3t<! 
 #$F-23UT UG3YYu%F171A1A1CD1C??$1CKD.4.>.>.@A.@d--/.@JAJ# 4 EAs   %CCC8C#c                 sZ    . ROp^pV P                  W#R7       VP                  W#R7       R# )r
   )Zncol)rV   N)r
   r   r   r   Zer?  r  )r   r   ZstringsrV   s   &&  r(   test_ncol_ncolsr  	  s*     -GEOOGO(NN7N(r*   c                  s.   \         P                  ! 4       w  r\        P                  ! \        R R7      ;_uu_ 4        VP                  RR.R7       RRR4       \        P                  ! \        RR7      ;_uu_ 4        VP                  RR.R7       RRR4       \        P                  ! \        RR7      ;_uu_ 4        VP                  R	R.R7       RRR4       R#   + '       g   i     L; i  + '       g   i     Lf; i  + '       g   i     R# ; i)
zFloc must be string, coordinate tuple, or an integer 0-10, not \(1.1,\)r   r;  r   r   NzWloc must be string, coordinate tuple, or an integer 0-10, not \(0.481, 0.4227, 0.4523\)zRloc must be string, coordinate tuple, or an integer 0-10, not \(0.481, 'go blue'\))r   )bX9?g:M?gm{?)r  zgo bluer   r   r   r   rG  r   rz   r{   r(    test_loc_invalid_tuple_exceptionr    s     llnGC	z +C 
E 
E
		g{m	4
E 
z +T 
V 
V
		-{m	D
V 
z +Q 
S 
S
		(+	?
S 
S
E 
E
V 
V
S 
S 
Ss#   C=C0>DC-	0D 	D	c                  s    \         P                  ! 4       w  rVP                  RR.R7       VP                  RR.R7       R# )r  r;  r  N)r  }?5^I?)r   r   r   r   r   rz   r{   r(   test_loc_valid_tupler  #  s3    llnGCII.+I7II&+I/r*   c                  s    \         P                  ! 4       w  rVP                  R R.R.R7       VP                  ^^.R.R7       R# )r  r  r;  r  Nr  rz   r{   r(   test_loc_valid_listr  )  s;    llnGCII5%.+I7II1a&+I/r*   c                  s    \         P                  ! 4       w  r\        P                  ! \        R R7      ;_uu_ 4        VP                  . ROR.R7       RRR4       R#   + '       g   i     R# ; i)zOloc must be string, coordinate tuple, or an integer 0-10, not \[1.1, 2.2, 3.3\]r   r;  r  N)r   r/  gffffff
@r  rz   r{   r(   test_loc_invalid_list_exceptionr  /  sU    llnGC	z +L 
N 
N
		o{m	<
N 
N 
N 
N   AA.	c                  s    \         P                  ! 4       w  r\        P                  ! \        R R7      ;_uu_ 4        VP                  RR/R.R7       RRR4       R#   + '       g   i     R# ; i)zKloc must be string, coordinate tuple, or an integer 0-10, not {'not': True}r   ZnotTr;  r  Nr  rz   r{   r(   test_loc_invalid_typer  6  sY    llnGC	z +F 
H 
H
		udm[M	:
H 
H 
H 
Hr  c                  s&   \         P                  ! 4       w  rVP                  ^ R.R7       VP                  ^R.R7       VP                  ^R.R7       VP                  ^
R.R7       \        P                  ! \
        RR7      ;_uu_ 4        VP                  ^R.R7       RRR4       \        P                  ! \
        RR7      ;_uu_ 4        VP                  RR.R7       RRR4       R#   + '       g   i     LS; i  + '       g   i     R# ; i)r    r;  r  z@loc must be string, coordinate tuple, or an integer 0-10, not 11r   Nz@loc must be string, coordinate tuple, or an integer 0-10, not -1rE   r   r   r   r   r   rG  rz   r{   r(   !test_loc_validation_numeric_valuer  =  s    llnGCII![MI*II![MI*II![MI*II"k]I+	z +; 
= 
=
		b+	/
= 
z +; 
= 
=
		b+	/
= 
=	
= 
=
= 
= 
=s   C,C?,C<	?D	c                  s   \         P                  ! 4       w  rR .pVP                  RVR7       VP                  RVR7       VP                  RVR7       VP                  RVR7       VP                  RVR7       VP                  RVR7       VP                  RVR7       VP                  RVR7       VP                  RVR7       VP                  R	VR7       VP                  R
VR7       VP                  RVR7       \        P                  ! \
        RR7      ;_uu_ 4        VP                  RVR7       RRR4       R#   + '       g   i     R# ; i)r;  r@   r  rC  r4   r   rE  r   r   rD  zlower centerzupper centerz 'wrong' is not a valid value forr   ZwrongNr  )r!   r"   r   rB   r(    test_loc_validation_string_valuer  L  s   llnGC]FII&I(II-I/II&I(II-I/II,vI.II,vI.II-I/II'&I)II-I/II.I0II.I0II.I0	z)K	L	L
		gf	- 
M	L	L	Ls   #EE	c                  sB   \         P                  ! \        ^
4      4      w  p \         P                  ! \        ^
4      4      w  p\        P                  ! \
        RR7      ;_uu_ 4        \         P                  ! W.. ROR7      pRRR4       R#   + '       g   i     R# ; i)r	   znumber of handles and labelsr   r&   r   Npl1pl2Zpl3)r   r6   r\   r   r   r=  r   r  r  r   rB   r(   !test_legend_handle_label_mismatchr  _  s_    88E"IDC88E"IDC	k)G	H	HSJ7LM 
I	H	H	Hs   'BB	c                  s    \         P                  ! \        ^
4      4      w  p \         P                  ! \        ^
4      4      w  p\         P                  ! \	        W.4      \	        . RO4      R7      pR# )r	   r  Nr  )r   r6   r\   r   Ziterr  rB   r(   (test_legend_handle_label_mismatch_no_lenr  h  sJ    88E"IDC88E"IDCZZcZ 0#$9:<Fr*   c                  s    \         P                  ! . RO4       \        P                  ! \        RR7      ;_uu_ 4        \         P
                  ! 4        RRR4       R#   + '       g   i     R# ; i)r   zNo artists with labels foundr   Nr   )r   r6   r   r   r=  r   r-   r*   r(   test_legend_nolabels_warningr  q  s9    HHY	{*H	I	I

 
J	I	I	Is   AA.	c                  s`    \         P                  ! . RO4       \         P                  ! 4        R# )r   Nr   )r   r6   r   r-   r*   r(   test_legend_nolabels_drawr  w  s    HHYJJLr*   c            
      sH   . ROp . R	Op. R
Op. p\         P                  ! ^RR7      w  rE\        VP                  R4       F  w  rgVP	                  WVRRRR7       VP                  ^ ^4       VP                  R^4       VP                  VR7      pVP                  P                  4        VP                  VP                  4       P                  VP                  P                  4       4      4       K  	  \        V^,          P                   V^ ,          P                   4       R# )r   rU   Zgrayr   zShaded Area)r%   r%  r   r5   Nr   )r   r   r   )r   r   r   r	   r   r@   r   rE   )r   r   r   rZ   r   rR   rS   r   r]   r^   r_   r`   ra   rb   rc   r   rd   )	r#   r  r  rf   r!   re   r"   r   rg   rW  r(   test_legend_loc_polycollectionr  ~  s     	A	B	BJ||!W5HCsxx!78
rs-P
Aq
BiiCi 

!!#//0E0E0GH	J 9 JqM((*Q-*>*>?r*   c                  s   \         P                  ! ^R
R7      w  r. p\        VP                  R4       F  w  r4^^.p^^.pVP	                  WVRR7       VP                  R^RRR7       VP                  VR7      pV P                  P                  4        VP                  VP                  4       P                  VP                  P                  4       4      4       K  	  \        V^,          P                  V^ ,          P                  4       R	# )r   rU   z	plot namer>   r  zsome text blahblahZtop)Zverticalalignmentr5   Nr  r  )r   r   r   rZ   r6   r<  r   r]   r^   r_   r`   ra   rb   rc   r   rd   )r!   re   rf   r"   r   r#   r$   rg   r   r(   test_legend_textr    s     ||!W5HCJsxx!78FF
K(
Q,FiiCi 

!!#//0E0E0GH	J 9 JqM((*Q-*>*>?r*   c                  s   \         P                  ! 4       w  rVP                  . R	ORR7       VP                  RR
R7       VP	                  ^ R7       \
        P                  P                  V RV P                  R7      ;_uu_ 4       pV P                  \        P                  ! 4       4       RRR4       XP                  4        R#   + '       g   i     L"; i)r   ZLiner>   r
   )rm   r5   _get_renderer)ZwrapsNr   )r   r   )r   r   r6   Zannotater   r   r   Zobjectr  ZsavefigioZBytesIOZassert_not_called)r!   r"   Zmocked_get_rendererrB   r(   test_legend_annotater    s    llnGCGGIVG$KKKII!I			(9(9 
 
; 
;>QBJJL!
;
 ))+
; 
;s   %CC	c                  sx   \         P                  P                  R 4       \         P                  P                  R4      p \        P                  ! ^^R7      w  r. ROpV^ ,          P                  V RVR7      pV^ ,          P                  4       w  rVV^,          P                  WRR7      pV^,          P                  4       w  rV\        P                  ! \        RR7      ;_uu_ 4        V^,          P                  WR	R R
7      pR	R	R	4       V^,          P                  V RR
7      p	R	#   + '       g   i     L,; i)i!N,)ZnrowsrV   box AT)Zpatch_artistr   F)r   Zshowboxz values must have same the lengthr   Nr>   )r	   r   )r  zbox Bzbox Czbox DrE   )
r   r   Zseedr   r   Zboxplotr   r   r   rG  )
r  r!   re   Zlegend_labelsZbp1r&   r   Zbp2Zbp3Zbp4s
             r(   test_boxplot_legend_labelsr    s    IINN899G$D||!1-HC8M a&..D.
FC!f668OG
 a&..E.
BC !f668OG
 
z)K	L	L!fnnTs);n< 
M a&..W.
-C	 
M	Ls   (D))D9	)rq   r  r   rp   )zoutside rightr   )r'  r$  )r   r   r   )TF)r  r  )r   r  r  Zplatformr  Zunittestr   r>  Znumpyr   Znumpy.testingr   r   Zmatplotlib.testing.decoratorsr   r   Zmatplotlib.testing._markersr   Zmatplotlib.pyplotZpyplotr   Z
matplotlibr   Zmatplotlib.patchesZpatchesrr   Zmatplotlib.transformsZ
transformsr1  Zmatplotlib.collectionsr5  Zmatplotlib.linesr   r  Zmatplotlib.legend_handlerr   Zmatplotlib.legendr   r-  r   Zmatplotlib.font_managerr   r)   r9   rC   rH   rT   ri   ru   r|   Zmachiner   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r   r*  r.  r0  r2  r7  r:  r@  rA  rF  rH  rJ  rK  rN  rP  rX  r  Zparametrizer[  r`  ra  rb  rh  rl  rp  rr  rt  ru  rx  r{  r  r  r  r  r  r  r  r  r  r  r  r  Zfilterwarningsr  r  r  r  r  r  rs   r  Zintr  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r-   r*   r(   <module>r     s    	       )  O 4   % + - ! 2 # ! 29$	1 %&D9 : %&D9: :: %&' (@,@@ ./TB' C' ,-4#++-9auF-F- -.D#++-9auF	IF	I #$$#++-9atE2E2 &'T#++-9atE	6E	6 ;-Tt<
E =
E <.d#++-9auFF $&78dK! L!  &'T:8 ;8 :,D	B. C.B#5$ (
 )
]N ]N@5 5p&+R )*#++-9auFF( -./" 0" 789+ :+:('" ./T#++-9auF!F!*7,-,#1L &AB, C,  347 57  ;<7 =7 &AB, C, "?@	> A	>	>	>	>	<<	>	>	>>&	>	>	>>" "?@
> A
>
>
>
>
>
> RS& T& m4, 5,A 
A 
A0" %)8)+5&/)B)D E+E+ 5!S/2, 3, %)8)+5&/)B)D E=E=#
#)I0I " () ))@"00=;0.&,( RS. T.@&@",Jr*   