+
     ]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                  4      ^8  g   Q hVP                  V ^R7      pVP                  VP                  8H  P                  4       '       g   Q hR# )   r(   N      )	r   r   r,   r   r   r   lenr)   all)r   r   r   Zcs1Zcs2r   r   test_contour_Nlevelsr7   N   s     			"f%AllnGC
**Q
Cszz?Q
**Qq*
!CJJ#**$))++++r   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_pathsr9   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)      ))      ?      @)rE   皙@)rE         @))       @rF   )rI   rG   )rI   rH   )rZg)r   r   r   maxdstackabsr   figurer   arrayr-   )r   r   r   r.   Zptsr   r   test_contour_manual_labelsrP   a   s    ;;ryyB'1b)9:DA
ryy#a&#a&)*A.AJJv3'	Q1	B
((7
8CJJr
((7
8CJJr
Cr   c                  s   \         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V^ ,          P                  4       R8X  g   Q hR# )r   r(   r?   Z0Ni)g?   )r   linspacer   r   r   r-   get_text)r   r   XYZZcontoursZpointZclabels           r   test_contour_manual_movetorX   o   s    
CA
CA;;qDA	1q1a4!A{{1As84H Ejj'2G 1: C'''r   Zcontour_disconnected_segments)r:   r;   r8   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# )	rQ   y              5@{Gz?333333?r(   r?   N)皙?皙?)r   ZmgridZsqrtr   rN   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?)r:   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)rB   r)   extendr   )redyellowZpinkblueZblack)rD   r4   i   r   )neitherminrK   both)rK   rg   )rh   rg   r[   )r   rcParamsr   r   r   r,   Z	enumerateZflatcontourfr   colorbar)_axsdatarB   r)   Zir   filledrb   Zfirst_colorZ
last_colorc               r   $test_given_colors_levels_and_extendsrs      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//)rf   Zgreyre   rd   )r   r   rk   Zset_edgecolors)r   r   Zcfr/   r   test_hatch_colorsru      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\	        Wp4      '       d   K  Q h	  R# )r    r)   rB   rb   N)      ?      ?rQ   g      ?      ?)r   r   r   Zget_edgecolorsr   )Zcolorrb   r   rm   r   r)   r.   rq   s   &&      r   test_single_color_and_extendrz      s^    
 Q!QALLNEA&F	AU	BB !#### !r   zcontour_log_locator.svgF)r;   r:   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   rF   rI   locator      $@rc   N             i)r   r   r   rR   r   exprk   r   Z
LogLocatorr   r)   powerr   rl   r   Z
get_yticks)r   r   ZNr   r   rT   rU   Z1Z2ro   rq   cbrr   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)r;   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   rN   subplots_adjustdatetimer   rO   ZrangeZ	timedeltar   r   Zsubplotr   rk   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# )皙?rF   rI   ry   rw   r~   TN)inline	transformFr   r   ))i   i   )ig  i"  )i	  i  ))rw   )r    g      )gffffff@rQ   )
r   r   r   r   pir   r   r   r-   Zadd_label_near)deltar   r   rT   rU   r   r   rV   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	^ V
9   g   Q hR#   + '       g   i     LC; iu up	i )r{   )r>   rx   rw   "_split_path_and_get_label_rotation)Zwraps)rA   N)r   r   r   rR   r   r   sincosr   r   ZpatchZobjectr   r-   Zcall_args_list)rm   r   ZlatsZlonsZwaveZmeanro   r.   Zmocked_splitterZcargsZidxss              r   test_label_contour_startr     sF    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D99
9 
9 Es   %F3G3G	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?rE   rI   maskcorner_maskN)FT)r   r   seedr   rR   r   r   r+   marO   r   rN   rk   )ZnZ
mask_levelZ	noise_ampr   r   r   r   r   rW   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)r]   rZ   rw   ffffff?rE   ra   N)r   rN   r"   r#   
ValueErrorrk   )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	symmetricr|   Nr2   i)	r   r   r,   r   ZMaxNLocatorrk   r   r)   rR   )r   r}   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# )rD   Nr   )r   r   rR   Zhypotr   rN   r   r-   )r   r   rJ   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                 sx   \         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VP                  4       V8X  d   K  Q h	  V F  pVP                  4       V8X  d   K  Q h	  R# )r    )ncols)zorder)r   use_clabeltextN)r   r   r   rK   rL   rM   r   r   r   rk   r-   Z
get_zorder)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# )rF   gGz@皙?r(   )Zinline_spacingNr   )rY   r\   rw   g?)r   r   r   r   r   r   r   r-   )r   r   rT   rU   rV   r   r   Z
contoursetrW   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VP                  P                  4       R8X  g   Q h\         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)normrg   )r)   r   rb   ri   rc   N)r      g      g      )g:0yE>g    _B)-C6?g    .A)r   rj   r   r   r   rR   r   r,   r   rk   r   rh   rK   rl   r   get_ylimr   rO   )r   r   r   ax3Zdata_expro   Z
levels_expr)   Zc1Zc2Zc3r   rr   r   test_contourf_log_extensionr     s   
 ',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55>>|+++	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   rj   r   r   r   r   r+   Z
pcolormeshr   rl   	add_linesr   r   r   )r   r   rT   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_imagesr8   r:   r;   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)rD   r4   rC   r   i   )r   rj   r   r   r,   r   rk   rl   )r   r   rn   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                 sL   \        R V RV/R7      ;_uu_ 4        \        P                  ! 4       w  rE\        P                  ! ^4      P                  ^^4      pVP                  WbR7      pVP                  4       ^ ,          V8X  g   Q h 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get_linewidths)Zrc_lines_linewidthZrc_contour_linewidthZcall_linewidthsZexpectedr   r   rT   r.   s   &&&&    r   test_contour_linewidthr     s     
)+=+-AC 
D 
D,,.IIcN""1a(ZZZ6  "1%111
D 
D 
D 
Ds   A.BB#	Zpdfc                  sf    \         P                  ! \         P                  ! ^^.^^..4      4       R# )rQ   N)r   r-   r    r   r   test_label_nonaggr     s&     JJs{{QFQF+,-r   Zcontour_closed_line_loop)r   r8   r:   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   rw   r   )r   Zalphag @g@N)r    r    r    )r    rD   r    )rD   rQ   rD   )rD   rD   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                  VP                  8w  g   Q hVP                  WR4      pVP                  VP                  8X  g   Q hR# )ra   rE   N)r   r   r   r   rk   r   _contour_generator)r   r   r   r   r   Zqcs1Zqcs2Zqcs3rW   r   test_quadcontourset_reuser     s     ;;SzC:.DA	AllnGC;;qQD::aAD""d&=&====::dD""d&=&====r   Zcontour_manualg{Gz?)r   r8   r:   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)rp   rt   rJ   k)r   rB   )rB   r   Nr4   r4   r    rQ   rD   )
rQ   rD   rD   rD   O   rQ   rD   rD   rD   r   )Zmatplotlib.contourr   r   r   )
r   r   r   rt   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	# )rC   r   g333333?ZdtypeTr   r   r   )r   rB   N)rC   r   )r    rQ   rD   r3   r4   r   )rQ   rQ   )rQ   r3   )r   r   r   r   
zeros_likeboolr   rO   rk   rl   r   r   )	r   r   r   r   r   r   rp   Zcbar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@)rQ   r    i!   YİØt?r   gb?)rQ   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   )rD   r   )r   r   r   r   r   r   rk   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       V P                   Uu0 uF  q"P                  4       kK  	  up0 Rm8X  g   Q hR# u upi )gư>r   r(   N)gh㈵>gh㈵>gh㈵?>   z0.25z1.00z4.00)
r   rN   add_subplotr   r   Z	geomspacer,   r-   ZtextsrS   )r   r.   Ztextr/   r   )test_contour_autolabel_beyond_powerlimitsr   F  sw    		!	!	#B	R\\$c2::2rB0
2BIIbM(*1MMO15MMMM1s   B)c                  s  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  rEV. RO8X  g   Q hRp\        ;QJ d    V3R lV 4       F  '       d   K   RM	  RM! V3R lV 4       4      '       g   Q h\        ;QJ d%    R	 \        WF4       4       F  '       d   K   RM	  RM! R	 \        WF4       4       4      '       g   Q hR
# )r    )	Rectangleri   rv   rd   rf   c              3   s<   <"   T F  p\        VS4      x  K  	  R # 5iN)
isinstance).0ar   s   & r   	<genexpr>0test_contourf_legend_elements.<locals>.<genexpr>b  s     9Az!Y''s   FTc              3   Z   "   T F!  w  r\        VP                  4       V4      x  K#  	  R # 5ir   )r   Zget_facecolorr   r   rq      &  r   r   r   c  s*      :841 !//+Q//8   )+Nr[   r   i   i2   )#FFFF00#FF00FFz#00FFFF)z$x \leq -1e+250s$z$10.0 < x \leq 30.0$z$30.0 < x \leq 50.0$z$x > 1e+250s$)rf   r   r   rd   )matplotlib.patchesr   r   r   r,   r   rk   rt   Zset_overZ	set_underZchangedlegend_elementsr6   zip)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 ' ' ' ' <O3993339999993 :w8:333 :w8: : : : :r   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  rVV. RO8X  g   Q h\        ;QJ d    R V 4       F  '       d   K   RM	  RM! R V 4       4      '       g   Q h\        ;QJ d%    R \        WS4       4       F  '       d   K   RM	  RM! R \        WS4       4       4      '       g   Q hR# )rQ   ri   rv   c              3   sj   "   T F)  p\        V\        P                  P                  4      x  K+  	  R # 5ir   )r   mplr   ZLine2D)r   r      & r   r   /test_contour_legend_elements.<locals>.<genexpr>r  s$     @1z!SYY--..s   13FTc              3   r   r   )r   Z	get_colorr   r   r   r   r   s  s)      1/41 !++-++/r   Nr[   )rf   z#00FF00rd   r   )z
$x = 10.0$z
$x = 30.0$z
$x = 50.0$)r   r   r,   r   r   r   r6   r   )r   r   r   rB   r.   r   r   r   r   test_contour_legend_elementsr   g  s    
		!RA			"aA	A'F	Q|""
$B ((*OG????3@@333@@@@@@3 1w/1333 1w/1 1 1 1 1r   zalgorithm, klassmpl2005mpl2014serialthreadedc                 s`   \         P                  ! R R.RR..4      pVe8   \        P                  ! W R7      p\	        VP
                  V4      '       g   Q hR# \        P                  ! \        4      ;_uu_ 4        \        P                  ! W R7       RRR4       R#   + '       g   i     R# ; i)rE   rI   rF         @N	algorithm)	r   rO   r   rk   r   r   r"   r#   r   )r   Zklassr   r.   r&   r   test_algorithm_namer   w  sv     	3*sCj)*A\\!1"//7777]]:&&LL0 '&&&s   :B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)	rE   rI   rF   r   F)r   r   r   TN)r   rO   r   rk   r"   r#   r   )r   r   r   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  ra   rE   rw   )ZscaleZsizer   Tr   r   r   )r   rB   Nr   r   r   r   )rC   r   )r3   r   )r   r   Zdefault_rngr   rR   r   r   Znormalr   r   r   rO   r   r   r   ravelrk   r   	set_title)
Z
algorithmsZrngr   r   r   r   rm   rn   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   rF   rI   )Znrowsr   T)r   rA   zSimplest default with labelsNr   r   )r   r   r   r   r   rN   Z
subfiguresr   r   r-   r  )r   r   r   rT   rU   r   r   rV   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   r;   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       VP                  e   Q h\        P
                  ! 4       w  rVP                  WEV^RV R	7      pVP                  V^	RR7       VP                  R
V  24       VP                  V 8X  g   Q h\        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       VP                  V 8X  g   Q hR# )r   rF   rI   r   rB   TrA   r   z0Single color - positive contours solid (default)N)rB   
linestylesz!Single color - positive contours dashdotrB   r	  negative_linestylesr   r   )
r   r   r   r   r   r   r   r-   r  r	  )r;   r   r   r   rT   rU   r   r   rV   fig1r   CS1fig2r   CS2fig3r   CS3s   &                 r   test_linestylesr    s    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=>>>U""" ID#
++aAq*3  5CJJsQtJ,MM5eW=>>>U"""r   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       VP                  R8X  g   Q h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       VP                  V 8X  g   Q h\        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       VP                  V 8X  g   Q h\        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       VP                  V 8X  g   Q hR# )r   rF   rI   r   r  Tr  z1Single color - negative contours dashed (default)dashedzcontour.negative_linestylez!Single color - negative contours z(using rcParams))rB   r  r
  r  Nr   r   )r   r   r   r   r   r   r   r-   r  r  rj   )r;   r   r   r   rT   rU   r   r   rV   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""h... 27CLL-.ID
++aAq+
-CJJsQtJ,MM5eW%& '""e+++ ID#
++aAq%+
HCJJsQtJ,MM5eW=>""e+++ ID#
++aAq*/  1CJJsQtJ,MM5eW=>""e+++r   c                  sp   \         P                  ! 4       P                  4       p V P                  4       pV P	                  \
        P                  ! ^4      P                  R4      4      pVP                  4        V P                  4       V8w  g   Q hVP                  4        V P                  4       V8X  g   Q hR# )r   Nr   )
r   rN   r   Zget_childrenr   r   r   r,   r-   Zremove)r   Zorig_childrenr.   r/   r   test_contour_remover    s    		!	!	#BOO%M	BIIbM))&1	2BIIK??---IIK??---r   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!   )rV   N)r   r   r"   r#   r$   r   )r   r   ro   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VP                  4       f   Q hR# )r    rw   )r   )Z	clip_pathN)r   r   mpatchesZCircleZ	transAxesr   Zget_clip_path)r   r   ro   Zcircler.   r   r   test_contour_clip_pathr    s`    llnGCFQFD__c3ZEF	D	+B)))r   c                  s0   \         P                  P                  ^^	4      w  r\         P                  ! ^	4      ^,          P	                  R4      P                  \        4      p. RO. RO. RO.p\        P                  ! VP                  4       4      P                  P                  4       R.8X  g   Q h\        P                  ! V4      P                  P                  4       R.8X  g   Q h\        P                  ! \         P                  P                  W#R7      4      P                  P                  4       R.8X  g   Q h\        P                  ! VP                  4       4      P                  P                  4       . RO8X  g   Q h\        P                  ! V4      P                  P                  4       . RO8X  g   Q h\        P                  ! \         P                  P                  W#R7      4      P                  P                  4       . RO8X  g   Q hVP                  4       p\        P                  ! WVP                  4       4      P                  P                  4       R.8X  g   Q h\        P                  ! WV4      P                  P                  4       R.8X  g   Q h\        P                   ! WVP                  4       4      P                  P                  4       . RO8X  g   Q h\        P                   ! WV4      P                  P                  4       . RO8X  g   Q hR# )rD   rw   r   N)r3   r3   )FFF)FTF)r    rw   rQ   )r   r   r+   r   r,   Zastyper   r   r   Ztolistr)   r   rO   rk   r  Z
tricontourZtricontourf)r   r   r   Zmr^   r   test_bool_autolevelr  %  s   99>>!QDA	1	""6*11$7A	 46KLA;;qxxz"))002rd:::;;q>  '')bT111;;ruu{{1{-.55<<>2$FFF<<
#**113zAAA<<?!!((*j888<<A./66==?:MMM		A>>!
+2299;tCCC>>!"))002rd:::??1,33::<
JJJ??1#**113zAA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ra   g [n=gvIh%,=g7Q5=r  )r   rO   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                  s   \         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 FG  p\        V4      ^8X  g   Q h\        V^ ,          4      ^8X  g   Q h\        V^,          4      ^8X  d   KG  Q h	  R# )r    rw   r(   N)
r   r   r   r   r   r   r   ZallsegsZallkindsr5   )r   r   r   r.   Zresultr   r   test_allsegs_allkindsr  =  s    ;;ryyB*BIIaQ,?@DA
q	BFF1IA	Q1aX	.B ::r{{+6{a6!9~"""6!9~""" ,r   r   )r   r   r*   )r3   r3   r3   ))darkredrg   )r  ri   ))rJ   rw   rg   ))r]   r\   rw   rZ   rg   ))T{     )Fr  r   )Tr  N)Fr  N))Gz?NNr!  )r!  (\@Nr"  )r!  r"  Gz@r#  )ZinvalidNr  )Zsolidr  r
  Zdotted)Wr   Zplatformr%   Zunittestr   Z	contourpyZnumpyr   Znumpy.testingr   r   Z
matplotlibr   r   r   r   r   Zmatplotlib.colorsr   r   r   Zpatchesr  Zmatplotlib.testing.decoratorsr	   r
   r"   r   r    ZmarkZparametrizer   Zemptyr'   r0   r7   r9   rP   rX   r_   Zmachiners   ru   rz   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Zbackendr   r   r   r   r   r   r   r;   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   