+
     ]iQv  c                   s
   ^ RI t ^ RIt^ RIt^ RIHt ^ RIt^ RIt^ RIH	t	H
t
 ^ RIt^ RIHtHtHt ^ RIHtHt ^ RIHt ^ RIHtHt ^ RItR tR t]P:                  P=                  R	]P>                  ! ^	4      ]P>                  ! ^	4      ]P@                  ! Rt4      3R
3]P>                  ! ^
4      ]P>                  ! ^
4      ]P@                  ! Rt4      3R3]P@                  ! Ru4      ]P>                  ! ^
4      ]P@                  ! Rt4      3R3]P>                  ! ^
4      ]P@                  ! Ru4      ]P@                  ! Rt4      3R3]P@                  ! Rv4      ]P@                  ! Rt4      ]P@                  ! Rt4      3R3]P@                  ! Rt4      ]P@                  ! Rv4      ]P@                  ! Rt4      3R3]P@                  ! Rw4      ]P@                  ! Rw4      ]P@                  ! Rt4      3R3]P@                  ! Rw4      ]P@                  ! Rw4      ]P@                  ! Rw4      3R3^ ..3R3^ .^ .^ ..3R3.
4      R 4       t!R t"R t#]! R.R7      R 4       t$]! R.RRRR7      R 4       t%R t&]! R .RRR.R!7      R" 4       t']! R#.R]PP                  ! 4       R$8X  d   ^ MR%R&7      R' 4       t)]! R(.RRR.R!7      R) 4       t*]P:                  P=                  R*. RxO4      R+ 4       t+]! R,.RR-R.7      R/ 4       t,]! R0.RR17      R2 4       t-]! R3.RRR4R7      R5 4       t.R6 t/]! R7R8.RR9R&7      R: 4       t0R; t1R< t2R= t3]P:                  P=                  R>. RyO4      R? 4       t4R@ t5]! RA.RRRBR7      RC 4       t6]! RD.RR]PP                  ! 4       R$8X  d   REMRFR7      RG 4       t7]! RH.R.RRRI7      RJ 4       t8]P:                  P=                  RK. RzO4      RL 4       t9]P:                  Pu                  RM4      RN 4       t;]! RO.R.RRP7      RQ 4       t<RR t=]! RS.R.RRTRU7      RV 4       t>]! RW.R.RRP7      RX 4       t?RY t@RZ tA]P                  P                  R[4      R\ 4       tDR] tER^ tF]P:                  P=                  R_R`]P                  3Ra]P                  3Rb]P                  3Rc]P                  3R{.4      Rd 4       tK]P:                  P=                  Re. R|O4      Rf 4       tL]! Rg.R.RRhRU7      Ri 4       tMRj tN]P:                  P=                  Rk. R}O4      Rl 4       tO]P:                  P=                  Rk. R}O4      Rm 4       tPRn tQRo tRRp tSRq tTRr tURs tVR# )~    N)mock)assert_array_almost_equalassert_array_almost_equal_nulp)pyplot
rc_contextticker)LogNorm
same_color)check_figures_equalimage_comparisonc                  s    \         P                  ! ^
4      p \         P                  ! ^	4      p\         P                  P                  R4      p\        P                  ! 4       w  r4VP                  WV4       R# 
   N	   r   )nparangerandompltsubplotscontour)xyzfigax        D/usr/lib64/python3.14/site-packages/matplotlib/tests/test_contour.pytest_contour_shape_1d_validr      sK    
		"A
		!A
		!AllnGCJJqQ    c                  s   \         P                  ! ^
4      p \         P                  ! ^	4      p\         P                  ! W4      w  r#\         P                  P                  R4      p\        P
                  ! 4       w  rVVP                  W#V4       R# r   )r   r   meshgridr   r   r   r   )r   r   ZxgZygr   r   r             r   test_contour_shape_2d_validr       s[    
		"A
		!A[[FB
		!AllnGCJJrqr   zargs, messagez6Length of x (9) must match number of columns in z (10)z3Length of y (10) must match number of rows in z (9)z4Number of dimensions of x (2) and y (1) do not matchz4Number of dimensions of x (1) and y (2) do not matchz-Shapes of x (9, 9) and z (9, 10) do not matchz-Shapes of y (9, 9) and z (9, 10) do not matchz'Inputs x and y must be 1D or 2D, not 3DzInput z must be 2D, not 3DzDInput z must be at least a (2, 2) shaped array, but has shape (1, 1)c                 s    \         P                  ! 4       w  r#\        P                  ! \        \
        P                  ! V4      R 7      ;_uu_ 4        VP                  ! V !   RRR4       R#   + '       g   i     R# ; i)ZmatchN)r   r   pytestraises	TypeErrorreZescaper   )ZargsZmessager   r      &&  r   test_contour_shape_errorr'   &   sF    . llnGC	y		'(:	;	;


D 
<	;	;	;s   A++A<	c                  sx   \         P                  ! 4       w  rVP                  \        P                  P                  ^	^	4      . R7       VP                  \        P                  ! ^Q4      P                  R4      ^d.R7      pVP                  V^dR/R7       VP                  \        P                  ! R4      4       R# )r   levelsz%1.2f)ZfmtNr   r   )
r   r   r   r   r   randr   reshapeclabelZones)r   r   cs      r   test_contour_no_valid_levelsr0   B   s}    llnGCJJryy~~a#BJ/	BIIbM))&13%	@BIIbsGnI%JJrwwvr   c                  s    \         P                  ! ^4      P                  R4      p \        P                  ! 4       w  rVP                  V ^4      pVP                  V ^R7      pR# )   r(   N      )r   r   r,   r   r   r   )r   r   r   Zcs1Zcs2r   r   test_contour_Nlevelsr5   N   sK     			"f%AllnGC
**Q
C
**Qq*
!Cr   Zpng)
extensionsc                 s    V P                  4       P                  ^ ^.^^..4      pVP                  4       P                  ^^ .^^..4      pVP                  VP                  4       4       R# )r    N)r   r   Z	set_pathsZ	get_paths)Zfig_testZfig_refZcs_testZcs_refr&   r   test_contour_set_pathsr7   Y   se    !))Aq6Aq6*:;G''!Q!Q(89Ff&&()r   Zcontour_manual_labelsTZmpl20gp=
ף?)remove_textstyletolc                  s(   \         P                  ! \         P                  ! ^ ^
4      \         P                  ! ^ ^
4      4      w  r\         P                  ! \         P                  ! \        V 4      \        V4      .4      ^4      p\        P                  ! R^R7       \        P                  ! WV4      p\         P                  ! . RO4      p\        P                  ! W4R7       \         P                  ! . RO4      p\        P                  ! W4RR	R7       R# )
r    )figsizedpimanualZsmall)r>   fontsizecolorsN)      ))      ?      @)rC   皙@)rC         @))       @rD   )rG   rE   )rG   rF   )rZg)r   r   r   maxdstackabsr   figurer   arrayr-   )r   r   r   r.   Zptsr   r   test_contour_manual_labelsrN   a   s    ;;ryyB'1b)9:DA
ryy#a&#a&)*A.AJJv3'	Q1	B
((7
8CJJr
((7
8CJJr
Cr   c                  sF   \         P                  ! R^
4      p \         P                  ! R^
4      p\         P                  ! W4      w  r#V^,          ^,          V^,          ,          ^,
          p\        P                  ! W#V^ ^d.R7      pRp\        P
                  ! WV.R7      pR# )r   r(   r=   Ni)g?   )r   linspacer   r   r   r-   )r   r   XYZZcontoursZpointZclabels           r   test_contour_manual_movetorU   o   sy    
CA
CA;;qDA	1q1a4!A{{1As84H Ejj'2Gr   Zcontour_disconnected_segments)r8   r9   r6   c                  s   \         P                  R^R1R^R13,          w  r^\         P                  ! RV R,           ^,          ,           V^,          ,           4      ,          pV^\         P                  ! RV R,
          ^,          ,           V^,          ,           4      ,          ,          p\        P                  ! 4        \        P
                  ! WV^.R7      pVP                  R.R7       R# )	rO   y              5@{Gz?333333?r(   r=   N)皙?皙?)r   ZmgridZsqrtr   rL   r   r-   )r   r   r   r.          r   -test_contour_label_with_disconnected_segmentsr\      s     88BqHb3h&'DA	BGGDAG>)AF233ARWWTQWN*Q!V34	44AJJL	Q1aS	)BIIj\I"r   z$contour_manual_colors_and_levels.pngZx86_64g;On?)r8   r:   c                  s   R \         P                  R&   \         P                  ! ^^4      w  r\        P                  ! ^4      P                  ^^4      p. ROp. ROp\        VP                  4       F  w  rVV^,          R8H  p. ROV^,          ,          pV'       d-   VR	9   d   ^MRp	VR
9   d   RMRp
VP                  W#W WHR7      pMVP                  W#RR WHR7      p\         P                  ! WR7       K  	  R# )Fpcolormesh.snap        N)r@   r)   extendr   )redyellowZpinkblueZblack)rB   r4   i   r   )neitherminrI   both)rI   rd   )re   rd   rX   )r   rcParamsr   r   r   r,   Z	enumerateZflatcontourfr   colorbar)_axsdatar@   r)   Zir   filledr_   Zfirst_colorZ
last_colorc               r   $test_given_colors_levels_and_extendsrp      s     ',CLL"#\\!QFA99R=  A&D7FF388$Q"216:  &);;!K%);;JD)G#)  :A 

4s"(  9A 	Q! %r   Zcontourf_hatch_colorsc                  s    \         P                  ! 4       w  rVP                  ^ ^.^^... RORR7      pVP                  . RO4       R# )r    Zgray)ZhatchescmapN)Z-Z/Z\z//)rc   Zgreyrb   ra   )r   r   rh   Zset_edgecolors)r   r   Zcfr/   r   test_hatch_colorsrr      sB     llnGC	q!fq!f%/EF	SB78r   zcolor, extendc                 s    ^ ^.^^..p\         P                  ! 4       w  r4. ROpVP                  W%WR7      pVP                  4        F  pK  	  R# )r    r)   r@   r_   N)      ?      ?rO   g      ?      ?)r   r   r   Zget_edgecolors)Zcolorr_   r   rj   r   r)   r.   rn   s   &&      r   test_single_color_and_extendrw      sK    
 Q!QALLNEA&F	AU	BB  r   zcontour_log_locator.svgF)r9   r8   c            
      s    \         P                  ! 4       w  r^dp\        P                  ! RRV4      p\        P                  ! RRV4      p\        P                  ! W44      w  rV\        P
                  ! V^,          ) V^,          ,
          4      p\        P
                  ! V^
,          ^,          ) V^
,          ^,          ,
          4      pV^2V,          ,           p	VP                  V	\        P                  ! 4       R7      p
\        V
P                  \        P                  ! R\        P                  ! R	^4      4      4       V P                  WR7      p\        VP                  P                  4       V
P                  4       R# )
d   rD   rG   locator      $@r`   N             i)r   r   r   rP   r   exprh   r   Z
LogLocatorr   r)   powerr   ri   r   Z
get_yticks)r   r   ZNr   r   rQ   rR   Z1Z2rl   rn   cbro   r   test_log_locator_levelsr      s    llnGCA
D#q!A
D#q!A;;qDA	A1	B	!b&1B{*	+BR<D
D&"3"3"56AahhryyQ7G(HI	a	Bbee..0!((;r   zcontour_datetime_axis.png)r9   c            
      s   \         P                  ! 4       p V P                  R RRR7       \        P                  ! R^^4      p\        P
                  ! \        ^4       Uu. uF   q!\        P                  ! VR7      ,           NK"  	  up4      p\        P                  ! ^4      p\        P                  ! \        P                  ! ^4      \        P                  ! ^4      4      w  rVWV,          p\         P                  ! ^4       \         P                  ! W4V4       \         P                  ! ^4       \         P                  ! W4V4       \        P                  ! V\        P                  ,          ^^ R7      p\        P                  ! VR\        P                  3,          ^^R7      p\         P                  ! ^4       \         P                  ! W4V4       \         P                  ! ^4       \         P                  ! W4V4       V P                  4        F<  pVP!                  4        F%  p	V	P#                  R4       V	P%                  ^4       K'  	  K>  	  R	# u upi )
g?g\(\?333333?)ZhspaceZtopZbottomi  )Zdays)Zaxis:NNNrightN)r   rL   subplots_adjustdatetimer   rM   ZrangeZ	timedeltar   r   Zsubplotr   rh   ZrepeatZnewaxisZget_axesZget_xticklabelsZset_haZset_rotation)
r   ZbaseZdr   r   Zz1Zz2r   r   Zlabel
             r   test_contour_datetime_axisr      s   
**,CsS9T1a(D
U2YGY++333YGHA
		"A[[2		"6FB
AKKKKaKKLLq
		!BJJ-!,A
		!ArzzM"BQ/AKKKKaKKLLqlln'')ELL!r" *  Hs   &Iz!contour_test_label_transforms.pngg?c                  sJ   R p \         P                  ! R
RV 4      p\         P                  ! RRV 4      p\         P                  ! W4      w  r4\         P                  ! V^,          V^,          ,           ) ^,          4      ^\         P                  ,          ,          p\         P                  ! V^,
          R,          ^,          V^,
          R,          ^,          ,           ) ^,          4      ^\         P                  ,          R,          R,          ,          pRWe,
          ,          p\
        P                  ! ^^4      w  rV	P                  W4V4      p
. ROp. ROpV
P                  4        V F  w  rV
P                  WRRR7       K  	  V F  w  rV
P                  WRR	R7       K  	  R# )皙?rD   rG   rv   rt   r{   TN)inline	transformFr|   r}   ))i   i   )ig  i"  )i	  i  ))rt   )r    g      )gffffff@rO   )
r   r   r   r~   pir   r   r   r-   Zadd_label_near)deltar   r   rQ   rR   r   r   rS   r   r   CSZ
disp_unitsZ
data_units                r   test_labelsr      s@   
 E
		$U#A
		$U#A;;qDA	!Q$A+"	#q255y	1B
&&QUcMA%!a%3(::;a?
@ruu9s?S "B 	All1a GC	A!	B5J0JIIK
!tt<  
!tu= r   c                  s   \         P                  ! ^dR7      w  r\        P                  ! \        P                  ) ^,          \        P                  ^,          ^24      ;r#\        P
                  ! W24      w  r2R\        P                  ! ^V,          4      ^,          ,          \        P                  ! ^V,          4      ,          pR\        P                  ! ^V,          4      ,          \        P                  ! ^V,          4      ^,          ^,           ,          pWE,           pVP                  W2V4      p\        P                  P                  VRVP                  R7      ;_uu_ 4       pVP                  ^	R7       RRR4       XP                   U	u. uF  q^ ,          ^,          NK  	  p
p	R#   + '       g   i     L:; iu up	i )rx   )r<   ru   rt   "_split_path_and_get_label_rotation)Zwraps)r?   N)r   r   r   rP   r   r   sincosr   r   ZpatchZobjectr   r-   Zcall_args_list)rj   r   ZlatsZlonsZwaveZmeanrl   r.   Zmocked_splitterZcargsZidxss              r   test_label_contour_startr     s<    LLS!EA++ruufqj"%%!)R88DT(JD266!d(#q()BFF1t8,<<DD!!bffQX&61%<q%@AD;D	D	%B			477 
 
9 
9<K
		1		
9 &5%C%CD%CE!HQKK%CDDD
9 
9 Es   %F*F=*F:	zcontour_corner_mask_False.pngzcontour_corner_mask_True.pnggGz?c                  s   ^<p RpRp\         P                  P                  ^.4       \         P                  ! \         P                  ! ^ RV 4      \         P                  ! ^ RV 4      4      w  r4\         P
                  ! ^V,          4      \         P                  ! ^V,          4      ,          V\         P                  P                  W 4      ,          ,           p\         P                  P                  W 4      V8  p\         P                  P                  WVR7      pR F/  p\        P                  ! 4        \        P                  ! WWR7       K1  	  R# )i<   ffffff?rC   rG   maskcorner_maskN)FT)r   r   seedr   rP   r   r   r+   marM   r   rL   rh   )ZnZ
mask_levelZ	noise_ampr   r   r   r   r   rT   r   test_corner_maskr   )  s     	AJIIINNA3;;r{{1c1-r{{1c1/EFDA
qsBFF1Q3K)BIINN1,@"@@A99>>!:-D
A!A$

Q0 %r   c                  s    R R.RR..p \         P                  ! 4        \        P                  ! \        4      ;_uu_ 4        \         P
                  ! V RR.4       RRR4       R#   + '       g   i     R# ; i)rZ   rW   rt   ffffff?rC   r^   N)r   rL   r"   r#   
ValueErrorrh   )r       r   test_contourf_decreasing_levelsr   :  sM    
sc3Z AJJL	z	"	"Qc
# 
#	"	"	"s    A$$A5	c                  s   \         P                  ! ^4      P                  R4      p \        P                  ! ^RR7      p\        P
                  ! WR7      p\        VP                  \         P                  ! R^^4      4       R# )r1   T)ZnbinsZ	symmetricry   Nr2   i)	r   r   r,   r   ZMaxNLocatorrh   r   r)   rP   )r   rz   r.   r/   r   test_contourf_symmetric_locatorr   B  sS    
		"f%AooA6G	a	)BbiiS"a)@Ar   c                  s@   \         P                  ! \         P                  ! R^^4      \         P                  ! R^^4      4      w  r\         P                  ! W4      p\        P
                  ! 4        \        P                  ! WV4      p\        P                  ! V4       R# )rB   Nr   )r   r   rP   Zhypotr   rL   r   r-   )r   r   rH   r.   r[   r   test_circular_contour_warningr   J  s_    ;;r{{2q!,bkk"a.CDDA
AJJL	Q1	BJJrNr   z-use_clabeltext, contour_zorder, clabel_zorderc                 s   \         P                  ! \         P                  ! ^ ^
4      \         P                  ! ^ ^
4      4      w  r4\         P                  ! \         P                  ! \        V4      \        V4      .4      ^4      p\        P                  ! ^R7      w  pw  rxVP                  W4WQR7      p	VP                  W4WQR7      p
V	P                  W R7      pV
P                  VV R7      pVf   ^V,           pMTpV F  pK  	  V F  pK  	  R# )r    )ncols)zorder)r   use_clabeltextN)r   r   r   rI   rJ   rK   r   r   r   rh   r-   )r   Zcontour_zorderZclabel_zorderr   r   r   r   ax1ax2r.   Z	cs_filledZclabels1Zclabels2Zexpected_clabel_zorderr-   s   &&&            r   test_clabel_zorderr   S  s     ;;ryyB'1b)9:DA
ryy#a&#a&)*A.All+OC#	Q1	4BQ1<IyyyMH}/=   ?H !">!1!.((r   c                  s@   \         P                  ! RRR4      ;r\         P                  ! W4      w  r#\         P                  ! V^,          ) V^,          ,
          4      p\        P
                  ! 4       w  rVVP                  W#V. ROR7      pVP                  V^dR7       R# )rD   gGz@皙?r(   )Zinline_spacingNr|   )rV   rY   rt   g?)r   r   r   r~   r   r   r   r-   )r   r   rQ   rR   rS   r   r   Z
contoursetrT   r   test_clabel_with_large_spacingr   l  sw     IIdD$''A;;qDA
1uq!t|AllnGCA!,?@JIIjI-r   zcontour_log_extension.pnggv?c            	      s   R \         P                  R&   \         P                  ! ^^RR7      w  p w  rpV P                  RRR7       \        P
                  ! RRR4      p\        P                  ! ^
V4      P                  ^^(4      p\        P                  ! RR4      p\        P                  ! R	V4      pVP                  V\        VP                  4       VP                  4       R
7      R7      pVP                  WW\        VP                  4       VP                  4       R
7      RR7      p	VP                  WW\        VP                  4       VP                  4       R
7      RR7      p
\         P                  ! WR7      p\         P                  ! WR7      p\        VP                  P!                  4       \        P"                  ! R4      4       \         P                  ! WR7      pR# )Fr]   r;   r   r   )Zleftr   g      #@i  g      @r{   )ZvminZvmax)normrd   )r)   r   r_   rf   r`   N)r      g      g      )-C6?g    .A)r   rg   r   r   r   rP   r   r,   r   rh   r   re   rI   ri   r   r   get_ylimrM   )r   r   r   ax3Zdata_exprl   Z
levels_expr)   Zc1Zc2Zc3r   ro   r   test_contourf_log_extensionr     sl   
 ',CLL"# <<1g>C#CT. {{4d+H88B!))"b1D3#JXXc:&F 
d"
D 
 
FB 
d"

6::<H& 
 
(B 
d"

6::<H# 
 
%B 
b	!B	b	!B"255>>#3RXXk5JK	b	!Br   zcontour_addlines.pnggQ?r   c                  s   R \         P                  R&   \         P                  ! 4       w  r\        P                  P                  R4       \        P                  P                  ^
^
4      R,          pVP                  V4      pVP                  VR,           4      pV P                  V4      pVP                  V4       \        VP                  P                  4       RR.^4       R# )Fr]   i,N,i'  i  gd]Kȓ\@g6>W'z@N)r   rg   r   r   r   r   r+   Z
pcolormeshr   ri   	add_linesr   r   r   )r   r   rQ   ZpcmZcontr   s         r   test_contour_addlinesr     s     ',CLL"#llnGCIINN8
		r2u$A
--
C::afD	c	BLLbeenn.:0FJr   Zcontour_uneven)baseline_imagesr6   r8   r9   c                  sn   R \         P                  R&   \        P                  ! ^4      P	                  ^^4      p \         P
                  ! ^^4      w  rV^ ,          pVP                  V . ROR7      pVP                  WCRR7       V^,          pVP                  V . ROR7      pVP                  WCRR7       R# )Fr]   r(   Zproportional)r   ZspacingZuniformN)rB   r4   rA   r   i   )r   rg   r   r   r,   r   rh   ri   )r   r   rk   r   r.   r   r   test_contour_unevenr     s     ',CLL"#
		"a#A||Aq!HC	QB	Q0	1BLLNL3	QB	Q0	1BLLIL.r   zCrc_lines_linewidth, rc_contour_linewidth, call_linewidths, expectedc                 s   \        R V RV/R7      ;_uu_ 4        \        P                  ! 4       w  rE\        P                  ! ^4      P                  ^^4      pVP                  WbR7      pRRR4       R#   + '       g   i     R# ; i)zlines.linewidthzcontour.linewidth)Zrc)
linewidthsN)r   r   r   r   r   r,   r   )Zrc_lines_linewidthZrc_contour_linewidthZcall_linewidthsZexpectedr   r   rQ   r.   s   &&&&    r   test_contour_linewidthr     su     
)+=+-AC 
D 
D,,.IIcN""1a(ZZZ6	
D 
D 
D 
Ds   AA33B	Zpdfc                  sf    \         P                  ! \         P                  ! ^^.^^..4      4       R# )rO   N)r   r-   r    r   r   test_label_nonaggr     s&     JJs{{QFQF+,-r   Zcontour_closed_line_loop)r   r6   r8   c                  s    . RO. R	O. RO. R
O.p \         P                  ! RR7      w  rVP                  V R.^.RR7       VP                  RR4       VP	                  RR4       R# )r    r   rt   r   )r   Zalphag @g@N)r    r    r    )r    rB   r    )rB   rO   rB   )rB   rB   g)r   r   r   Zset_xlimZset_ylim)r   r   r   r/   r   test_contour_closed_line_loopr     sV     
Iy)4All6*GCJJq3%RDJ4KKcKKcr   c                  s    \         P                  ! R R.R R.4      w  rW,           p\        P                  ! 4       w  r4VP	                  WV4      pVP                  WV4      pVP                  WR4      pR# )r^   rC   N)r   r   r   r   rh   r   )r   r   r   r   r   Zqcs1Zqcs2Zqcs3rT   r   test_quadcontourset_reuser     s`     ;;SzC:.DA	AllnGC;;qQD::aAD::dDr   Zcontour_manualg{Gz?)r   r6   r8   r:   c                  s   ^ RI Hp  \        P                  ! RR7      w  rRp^^ .^^.^^...p^^ .^^..^^.^^...p^ ^ .^ ^.^^.^^.^^ ...p^^ .^^ .^^.^^.^^..^^.^^.^^...pV ! V. ROWg.RVR7       V ! V^^.WE.^RR.R7       ^^ .^^ .^^.^^.^^ .^^.^^.^^.^^.^^..
.p. RO.p	V ! V^^.V.V	.RVR7       V ! V^.V.V	.R^R	7       R
# )r    )
ContourSetr   ZviridisT)rm   rq   rH   k)r   r@   )r@   r   Nr4   r4   r    rO   rB   )
rO   rB   rB   rB   O   rO   rB   rB   rB   r   )Zmatplotlib.contourr   r   r   )
r   r   r   rq   Zlines0Zlines1Zfilled01Zfilled12ZsegsZkindsr   r   test_contour_manualr     sw    .ll6*GCD 1v1v1v&'F1v1v!Q!Q 01FQ!Q!Q!Q!Q89HQ!Q!Q!Q!Q8Q!Q!Q(*Hr9x24dKrAq6F+3*M VaVaVaVaVVaVaVaVaV5 6D-.ErAq6D6E74dCrA3Br   Z!contour_line_start_on_corner_edgec                  s   \         P                  ! R
R7      w  r\        P                  ! . RO. RO4      w  r#RV^,
          ^,          ,
          V^,
          ^,          ,           p\        P                  ! V\
        R7      pR;VR&   VR&   \        P                  P                  WER7      pVP                  W#VRR7      pV P                  V4      pVP                  W#VRRR7      pVP                  V4       R	# )rA   r   g333333?ZdtypeTr   r   r   )r   r@   N)rA   r   )r    rO   rB   r3   r4   r   )rO   rO   )rO   r3   )r   r   r   r   
zeros_likeboolr   rM   rh   ri   r   r   )	r   r   r   r   r   r   rm   ZcbarZliness	            r   &test_contour_line_start_on_corner_edger     s     ll6*GC;;	2DAq1uqjAEA:%A==$'D""DJd
A!A[[qd[3F<<DJJqQDJ=ENN5r   c                  s   \         P                  ! R4      p \         P                  ! \         P                  ) \         P                  ! V ^,
          ^,          ^ 4      R,          ,          4      p\
        P                  ! V^
4      pVP                  ^^RR7      pRp\        W44       VP                  ^^RR7      pRp\        W44       VP                  ^^RR7      pR	p\        W44       VP                  ^^R
RR7      pRp\        W44       R# )   Fpixelindicesr   Nr   r         9@)rO   r    i!   YİØt?r   gb?)rO   r    r   g`3@gDlpf?gݓ?)r3   r    i   gͰQo&?ghW!@g|o^}?r      )r   r       gA*Ŏ@g      @gA?)	r   r   r~   r   sumr   r   find_nearest_contourr   )xyimgr.   Znearest_contourZexpected_nearestr   r   test_find_nearest_contourr   !  s    	H	B
&&"%%26626A+q1%78
9C	S"	B--a%-@O?o@--a%-@O>o@--a%-@O?o@--aF%-PO:o@r   c            	      s
   \         P                  ! R4      p \         P                  ! \         P                  ) \         P                  ! V ^,
          ^,          ^ 4      R	,          ,          4      p\
        P                  ! V^
4      p\        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       \        P                  ! \        RR7      ;_uu_ 4        VP                  ^^RRR7       RRR4       R#   + '       g   i     L; i  + '       g   i     Lg; i  + '       g   i     R# ; i)r   z'Method does not support filled contoursr!   Fr   Nr   Tr   r   r   )rB   r   )r   r   r~   r   r   r   rh   r"   r#   r   r   )r   r   r.   r/   r   #test_find_nearest_contour_no_filledr   7  s   	H	B
&&"%%26626A+q1%78
9C	c2	B	z)R	S	S
1E2 
T 
z)R	S	S
2vUC 
T 
z)R	S	S
1fDA 
T	S 
T	S 
T	S 
T	S	Ss$   (E)E+E1E	E.	1F	Zdefaultc                  s    \         P                  ! 4       P                  4       p \         P                  ! \        P
                  ! R R^d4      P                  ^
^
4      . ROR7      pV P                  V4       R# )gư>r   r(   N)gh㈵>gh㈵>gh㈵?)r   rL   add_subplotr   r   Z	geomspacer,   r-   )r   r.   s     r   )test_contour_autolabel_beyond_powerlimitsr   F  sN    		!	!	#B	R\\$c2::2rB0
2BIIbMr   c                  sf  a ^ RI Ho \        P                  ! ^^
4      p V P	                  R^4      pW,          p\
        P                  ! V. RO. R	ORR7      pVP                  P                  R4       VP                  P                  R4       VP                  4        VP                  4       w  rER
pR# )r    )	Rectanglerf   rs   ra   rc   NrX   r   i   i2   )#FFFF00#FF00FFz#00FFFF)rc   r   r   ra   )matplotlib.patchesr   r   r   r,   r   rh   rq   Zset_overZ	set_underZchangedlegend_elements)r   r   hr.   artistslabelsZexpected_colorsr   s          @r   test_contourf_legend_elementsr   P  s    ,
		!RA			"aA	A	a>#
%B GGUGGfJJL((*OG
 <Or   c                  s    \         P                  ! ^^
4      p V P                  R^4      pW,          p. ROp\        P                  ! V. ROVRR7      pVP                  4       w  rVR# )rO   rf   rs   NrX   )rc   z#00FF00ra   r   )r   r   r,   r   r   r   )r   r   r   r@   r.   r   r   r   r   test_contour_legend_elementsr   g  sZ    
		!RA			"aA	A'F	Q|""
$B ((*OGVr   zalgorithm, klassmpl2005mpl2014serialthreadedc                 s$   \         P                  ! R R.RR..4      pVe   \        P                  ! W R7      pR# \        P
                  ! \        4      ;_uu_ 4        \        P                  ! W R7       RRR4       R#   + '       g   i     R# ; i)rC   rG   rD         @N	algorithmr   rM   r   rh   r"   r#   r   )r   Zklassr   r.   r&   r   test_algorithm_namer   w  s_     	3*sCj)*A\\!1 ]]:&&LL0 '&&&s   A>>B	r   c                 s^   \         P                  ! R R.RR..4      p\        P                  ! WRR7       V R8w  d   \        P                  ! WRR7       R# \        P
                  ! \        4      ;_uu_ 4        \        P                  ! WRR7       RRR4       R#   + '       g   i     R# ; i)	rC   rG   rD   r   F)r   r   r   TNr   )r   r   s   & r   #test_algorithm_supports_corner_maskr     ss     	3*sCj)*A LLU; IQ>]]:&&LLTB '&&&s   8BB,	Zcontour_all_algorithmsgQ?c            	      s   . ROp \         P                  P                  R4      p\         P                  ! \         P                  ! RR^
4      \         P                  ! RR^4      4      w  r#\         P
                  ! ^V,          4      \         P                  ! ^
V,          4      ,          VP                  RRR7      ,           p\         P                  ! V\        R7      pRVR&   \         P                  P                  WER7      p\        P                  ! ^^4      w  rg\        VP                  4       V 4       F=  w  rVP!                  W#WIR	7       VP#                  W#WIR
R7       VP%                  V	4       K?  	  R# )r   i  r^   rC   rt   )ZscaleZsizer   Tr   r   r   )r   r@   Nr   r   r   r   )rA   r   )r3   r   )r   r   Zdefault_rngr   rP   r   r   Znormalr   r   r   rM   r   r   Zzipravelrh   r   	set_title)
Z
algorithmsZrngr   r   r   r   rj   rk   r   r   r   r   test_all_algorithmsr     s    >J
))


%C;;r{{3R0"++c32JKDA
r!tRVVBqD\!CJJSwJ$GGA==$'DDJ
A!A\\!QFASYY[*5
A!1


1
<
Y 6r   c                  st   R p \         P                  ! RRV 4      p\         P                  ! R	RV 4      p\         P                  ! W4      w  r4\         P                  ! V^,          ) V^,          ,
          4      p\         P                  ! V^,
          ^,          ) V^,
          ^,          ,
          4      pWV,
          ^,          p\        P
                  ! 4       pVP                  ^^R7      p	V	 FJ  p
V
P                  4       pVP                  W4V4      pVP                  VR^
R7       VP                  R4       KL  	  R# )
r   rD   rG   )Znrowsr   T)r   r?   zSimplest default with labelsNr|   r}   )r   r   r   r~   r   rL   Z
subfiguresr   r   r-   r   )r   r   r   rQ   rR   r   r   rS   r   ZfigsZfr   r   r   r   test_subfigure_clabelr     s    E
		$U#A
		$U#A;;qDA	!Q$!Q$	B	1q5Q,1q5Q,.	/B	AA
**,C>>>+DZZ\ZZa 
		"TB	/
34	 r   r9   c           
      s~   R p\         P                  ! RRV4      p\         P                  ! RRV4      p\         P                  ! W#4      w  rE\         P                  ! V^,          ) V^,          ,
          4      p\         P                  ! V^,
          ^,          ) V^,
          ^,          ,
          4      pWg,
          ^,          p\        P
                  ! 4       w  rV
P                  WEV^RR7      pV
P                  V^	RR7       V
P                  R4       \        P
                  ! 4       w  rVP                  WEV^RV R7      pVP                  V^	RR7       VP                  R	V  24       \        P
                  ! 4       w  ppVP                  WEV^RV R
R7      pVP                  V^	RR7       VP                  R	V  24       R# )r   rD   rG   r   r@   Tr?   r   z0Single color - positive contours solid (default))r@   
linestylesz!Single color - positive contours dashdotr@   r   negative_linestylesNr|   r}   )	r   r   r   r~   r   r   r   r-   r   )r9   r   r   r   rQ   rR   r   r   rS   fig1r   CS1fig2r   CS2fig3r   CS3s   &                 r   test_linestylesr    sq    E
		$U#A
		$U#A;;qDA	A1	B	!a%!q1uqj(	)B	AA ID
++aAq+
-CJJsQtJ,MMDE ID
++aAq+
?CJJsQtJ,MM5eW=> ID#
++aAq*3  5CJJsQtJ,MM5eW=>r   c           
      sP   R p\         P                  ! RRV4      p\         P                  ! RRV4      p\         P                  ! W#4      w  rE\         P                  ! V^,          ) V^,          ,
          4      p\         P                  ! V^,
          ^,          ) V^,
          ^,          ,
          4      pWg,
          ^,          p\        P
                  ! 4       w  rV
P                  WEV^RR7      pV
P                  V^	RR7       V
P                  R4       V \        P                  R&   \        P
                  ! 4       w  rVP                  WEV^RR7      pVP                  V^	RR7       VP                  R	V  R
24       \        P
                  ! 4       w  ppVP                  WEV^RV R7      pVP                  V^	RR7       VP                  R	V  24       \        P
                  ! 4       w  ppVP                  WEV^RRV R7      pVP                  V^	RR7       VP                  R	V  24       R# )r   rD   rG   r   r   Tr   z1Single color - negative contours dashed (default)zcontour.negative_linestylez!Single color - negative contours z(using rcParams))r@   r   r   r   Nr|   r}   )
r   r   r   r~   r   r   r   r-   r   rg   )r9   r   r   r   rQ   rR   r   r   rS   r   r   r   r   r   r   r   r   r   Zfig4Zax4ZCS4s   &                    r   test_negative_linestylesr    s    E
		$U#A
		$U#A;;qDA	A1	B	!a%!q1uqj(	)B	AA ID
++aAq+
-CJJsQtJ,MMEF 27CLL-.ID
++aAq+
-CJJsQtJ,MM5eW%& '
 ID#
++aAq%+
HCJJsQtJ,MM5eW=> ID#
++aAq*/  1CJJsQtJ,MM5eW=>r   c                  s   \         P                  ! 4       P                  4       p V P                  4       pV P	                  \
        P                  ! ^4      P                  R4      4      pVP                  4        VP                  4        R# )r   Nr   )
r   rL   r   Zget_childrenr   r   r   r,   r-   Zremove)r   Zorig_childrenr.   r/   r   test_contour_remover    sU    		!	!	#BOO%M	BIIbM))&1	2BIIKIIKr   c                  s    \         P                  ! 4       w  r^ ^.^^ ..p\        P                  ! \        RR7      ;_uu_ 4        VP                  VR7       RRR4       R#   + '       g   i     R# ; i)r    zcontour\(\) takes from 1 to 4r!   )rS   N)r   r   r"   r#   r$   r   )r   r   rl   r/   r   test_contour_no_argsr    sQ    llnGCFQFD	y(H	I	I


T
 
J	I	I	Is   A!!A2	c                  s    \         P                  ! 4       w  r^ ^.^^ ..p\        P                  ! RR.RVP                  R7      pVP                  W#R7      pR# )r    rt   )r   )Z	clip_pathN)r   r   mpatchesZCircleZ	transAxesr   )r   r   rl   Zcircler.   r   r   test_contour_clip_pathr    sK    llnGCFQFD__c3ZEF	D	+Br   c                  s    \         P                  P                  ^^	4      w  r\         P                  ! ^	4      ^,          P	                  R4      P                  \        4      p. RO. RO. RO.pVP                  4       pR# )rB   N)r3   r3   )FFF)FTF)r   r   r+   r   r,   Zastyper   r   )r   r   r   Zmr[   r   test_bool_autolevelr  %  s[    99>>!QDA	1	""6*11$7A	 46KLA 	
	Ar   c                  s   \         P                  ! \         P                  \         P                  .\         P                  \         P                  ..4      p \        \        P
                  ! V 4      P                  . RO4       R# )vIh%<=N)	gvIh%<g7Q5gvIh%,g [nr^   g [n=gvIh%,=g7Q5=r  )r   rM   Znanr   r   r   r)   )r   r   r   test_all_nanr	  6  sN    
266266"RVVRVV$456Ackk!n33@Ar   c                  sf   \         P                  ! \         P                  ! ^ ^
^4      \         P                  ! ^ ^
^4      4      w  r\         P                  ! V 4      \         P                  ! V4      ,          p\
        P                  ! WV^ R.R7      pVP                  VP                  3 F  pK  	  R# )r    rt   r(   N)	r   r   r   r   r   r   r   ZallsegsZallkinds)r   r   r   r.   Zresultr   r   test_allsegs_allkindsr
  =  su    ;;ryyB*BIIaQ,?@DA
q	BFF1IA	Q1aX	.B ::r{{++r   r   )r   r   r*   )r3   r3   r3   ))darkredrd   )r  rf   ))rH   rt   rd   ))rZ   rY   rt   rW   rd   ))T{     )Fr  r  )Tr  N)Fr  N))Gz?NNr  )r  (\@Nr  )r  r  Gz@r  )ZinvalidNr   )ZsolidZdashedr   Zdotted)Wr   Zplatformr%   Zunittestr   Z	contourpyZnumpyr   Znumpy.testingr   r   Z
matplotlibZmplr   r   r   r   Zmatplotlib.colorsr   r   r   Zpatchesr  Zmatplotlib.testing.decoratorsr	   r
   r"   r   r    ZmarkZparametrizer   Zemptyr'   r0   r5   r7   rN   rU   r\   Zmachinerp   rr   rw   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Zbackendr   r   r   r   r   r   r   r9   Zcontextr   r   r   ZMpl2005ContourGeneratorZMpl2014ContourGeneratorZSerialContourGeneratorZThreadedContourGeneratorr   r   r   r   r  r  r  r  r  r  r	  r
  r   r   r   <module>r     s     	    S  8 8 1 % O  iilBIIaL"((7"34=?iimRYYr]BHHW$56:<hhx"))B-'):;;=iimRXXh''):;;=hhv)288G+<=46hhw&)288G+<=46hhy288I.0AB.0hhy288I.0CD!#	seXKMcA3!KM'+ ,-,	 , (* )* *+WRVW
D X
D(& 23"'ugG#G# 9:#++-9auFF< *+"'ugG9G9  +N O$	O$ ,-W%P< Q<( ./w?# @#0 67"'s<><>82 24RS".1.1$B HAB=B=,.& ./"'""B )*G&..0H<d$HK	HK #3"4#W$gG/G/ I L
22 U. .
 #=">#W$88
> #3"4#W$DBCBC0 #F"G#W$88A,B 9N N:.1  223223	001)445	11 =?C?C #;"<#W$DB B "5( 57#7#@ 57&,7&,R.*B"A
#r   