+
    iQv                     
   ^ 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                      \         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axs        }/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/matplotlib/tests/test_contour.pytest_contour_shape_1d_validr      sK    
		"A
		!A
		!AllnGCJJqQ    c                     \         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   xgygr   r   r   s          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                     \         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)matchN)r   r   pytestraises	TypeErrorreescaper   )argsmessager   r   s   &&  r   test_contour_shape_errorr/   &   sF    . llnGC	y		'(:	;	;


D 
<	;	;	;s   A++A<	c                  x   \         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)fmtNr   r   )
r   r   r   r   r   randr   reshapeclabelones)r   r   css      r   test_contour_no_valid_levelsr:   B   s}    llnGCJJryy~~a#BJ/	BIIbM))&13%	@BIIbsGnI%JJrwwvr   c                  ^   \         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# )   r1   N      )	r   r   r6   r   r   r   lenr2   all)r   r   r   cs1cs2s        r   test_contour_NlevelsrD   N   s     			"f%AllnGC
**Q
Cszz?Q
**Qq*
!CJJ#**$))++++r   png)
extensionsc                     V P                  4       P                  ^ ^.^^..4      pVP                  4       P                  ^^ .^^..4      pVP                  VP                  4       4       R# )r   N)r   r   	set_paths	get_paths)fig_testfig_refcs_testcs_refs   &&  r   test_contour_set_pathsrN   Y   se    !))Aq6Aq6*:;G''!Q!Q(89Ff&&()r   contour_manual_labelsTmpl20gp=
ף?)remove_textstyletolc                  (   \         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manualsmall)rX   fontsizecolorsN)      ))      ?      @)r^   皙@)r^         @))       @r_   )rb   r`   )rb   ra   )rg)r   r!   r   maxdstackabsr   figurer   arrayr7   )r   r   r   r9   ptss        r   test_contour_manual_labelsrk   a   s    ;;ryyB'1b)9:DA
ryy#a&#a&)*A.AJJv3'	Q1	B
((7
8CJJr
((7
8CJJr
Cr   c                     \         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   r1   rW   0Ni)g?   )r   linspacer!   r   r   r7   get_text)r   r   XYZcontourspointclabelss           r   test_contour_manual_movetorw   o   s    
CA
CA;;qDA	1q1a4!A{{1As84H Ejj'2G 1: C'''r   contour_disconnected_segments)rQ   rR   rF   c                     \         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# )	rn   y              5@{Gz?333333?r1   rW   N)皙?皙?)r   mgridsqrtr   rh   r   r7   )r   r   r   r9   s       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.pngx86_64g;On?)rQ   rS   c                     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[   r2   extendr   )redyellowpinkblueblack)r]   r?      r   )neitherminre   both)re   r   )r   r   r|   )r   rcParamsr   r   r   r6   	enumerateflatcontourfr   colorbar)_axsdatar[   r2   ir   filledr   first_color
last_colorcs               r   $test_given_colors_levels_and_extendsr      s     ',CLL"#\\!QFA99R=  A&D7FF388$Q"216:  &);;!K%);;JD)G#)  :A 

4s"(  9A 	Q! %r   contourf_hatch_colorsc                      \         P                  ! 4       w  rVP                  ^ ^.^^... RORR7      pVP                  . RO4       R# )r   gray)hatchescmapN)-/\z//)r   greyr   r   )r   r   r   set_edgecolors)r   r   cfs      r   test_hatch_colorsr      sB     llnGC	q!fq!f%/EF	SB78r   zcolor, extendc                     ^ ^.^^..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   r2   r[   r   N)      ?      ?rn   g      ?      ?)r   r   r   get_edgecolorsr
   )colorr   r   r   r   r2   r9   r   s   &&      r   test_single_color_and_extendr      s^    
 Q!QALLNEA&F	AU	BB !#### !r   zcontour_log_locator.svgF)rR   rQ   c            
          \         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   r_   rb   locator      $@r   N             i)r   r   r   ro   r!   expr   r   
LogLocatorr   r2   powerr   r   r   
get_yticks)r   r   Nr   r   rq   rr   Z1Z2r   r   cbs               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)rR   c            
         \         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?)hspacetopbottomi  )days)axis:NNNrightN)r   rh   subplots_adjustdatetimer   ri   range	timedeltar   r!   subplotr   r   repeatnewaxisget_axesget_xticklabelsset_haset_rotation)
r   basedr   r   z1z2r   r   labels
             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                  J   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# )皙?r_   rb   r   r   r   TN)inline	transformFr   r   ))      )ig  i"  )i	  i  ))r   )r   g      )gffffff@rn   )
r   r   r!   r   pir   r   r   r7   add_label_near)deltar   r   rq   rr   r   r   rs   r   r   CS
disp_units
data_unitss                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                     \         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   )rV   r   r   "_split_path_and_get_label_rotation)wraps)rZ   N)r   r   r   ro   r   r!   sincosr   r   patchobjectr   r7   call_args_list)r   r   latslonswavemeanr   r9   mocked_splittercargs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                     ^<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# )<   ffffff?r^   rb   maskcorner_maskN)FT)r   r   seedr!   ro   r   r   r5   mari   r   rh   r   )n
mask_level	noise_ampr   r   r   r   r   s           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                      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~   r{   r   ffffff?r^   r   N)r   rh   r(   r)   
ValueErrorr   )r   s    r   test_contourf_decreasing_levelsr
  :  sM    
sc3Z AJJL	z	"	"Qc
# 
#	"	"	"s    A$$A5	c                     \         P                  ! ^4      P                  R4      p \        P                  ! ^RR7      p\        P
                  ! WR7      p\        VP                  \         P                  ! R^^4      4       R# )r<   T)nbins	symmetricr   Nr=   i)	r   r   r6   r   MaxNLocatorr   r   r2   ro   )r   r   r9   s      r   test_contourf_symmetric_locatorr  B  sS    
		"f%AooA6G	a	)BbiiS"a)@Ar   c                  @   \         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# )r]   Nr   )r   r!   ro   hypotr   rh   r   r7   )r   r   rc   r9   s       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                 x   \         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   re   rf   rg   r   r   r   r   r7   
get_zorder)r  contour_zorderclabel_zorderr   r   r   r   ax1ax2r9   	cs_filledclabels1clabels2expected_clabel_zorderr7   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                  @   \         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# )r_   gGz@皙?r1   )inline_spacingNr   )rz   r}   r   g?)r   r   r!   r   r   r   r   r7   )r   r   rq   rr   rs   r   r   
contoursets           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            	         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   rU   r"  r   )leftr   g      #@i  g      @r   )vminvmax)normr   )r2   r+  r   r   r   N)r      g      g      )g:0yE>g    _B)-C6?g    .A)r   r   r   r   r   ro   r   r6   r   r   r	   r   re   r   r   get_ylimr   ri   )r   r  r  ax3data_expr   
levels_expr2   c1c2c3r   s               r   test_contourf_log_extensionr5    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                     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   r   r   r   r   r  r5   
pcolormeshr   r   	add_linesr   r   r.  )r   r   rq   pcmcontr   s         r   test_contour_addlinesr;    s     ',CLL"#llnGCIINN8
		r2u$A
--
C::afD	c	BLLbeenn.:0FJr   contour_uneven)baseline_imagesrF   rQ   rR   c                  n   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   r1   proportional)r   spacinguniformN)r]   r?   r\   r      )r   r   r   r   r6   r   r   r   )r   r   r   r   r9   s        r   test_contour_unevenrC    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                 L   \        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)rc)
linewidthsN)r   r   r   r   r   r6   r   get_linewidths)rc_lines_linewidthrc_contour_linewidthcall_linewidthsexpectedr   r   rq   r9   s   &&&&    r   test_contour_linewidthrL    s     
)+=+-AC 
D 
D,,.IIcN""1a(ZZZ6  "1%111
D 
D 
D 
Ds   A.BB#	pdfc                  f    \         P                  ! \         P                  ! ^^.^^..4      4       R# )rn   N)r   r7   r    r   r   test_label_nonaggrP    s&     JJs{{QFQF+,-r   contour_closed_line_loop)r=  rF   rQ   c                      . 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'  r   r  )rF  alphag @g@N)r   r   r   )r   r]   r   )r]   rn   r]   )r]   r]   g)r   r   r   set_xlimset_ylim)r   r   r   s      r   test_contour_closed_line_looprV    sV     
Iy)4All6*GCJJq3%RDJ4KKcKKcr   c                  \   \         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# )r   r^   N)r   r!   r   r   r   r   _contour_generator)r   r   r   r   r   qcs1qcs2qcs3s           r   test_quadcontourset_reuser\    s     ;;SzC:.DA	AllnGC;;qQD::aAD""d&=&====::dD""d&=&====r   contour_manualg{Gz?)r=  rF   rQ   rS   c                     ^ 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'  viridisT)r   r   rc   k)rF  r[   )r[   rF  Nr?   r?   r   rn   r]   )
rn   r]   r]   r]   O   rn   r]   r]   r]   rd  )matplotlib.contourr_  r   r   )
r_  r   r   r   lines0lines1filled01filled12segskindss
             r   test_contour_manualrl    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   !contour_line_start_on_corner_edgec                     \         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	# )r\   r'  g333333?dtypeTr   r   ra  )r   r[   N)r\   r,  )r   rn   r]   r>   r?   rc  )rn   rn   )rn   r>   )r   r   r   r!   
zeros_likeboolr  ri   r   r   r   r8  )	r   r   r   r   r   r   r   cbarliness	            r   &test_contour_line_start_on_corner_edgeru    s     ll6*GC;;	2DAq1uqjAEA:%A==$'D""DJd
A!A[[qd[3F<<DJJqQDJ=ENN5r   c                     \         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indicesry  Nrw  rw        9@)rn   r   !   YİØt?r  gb?)rn   r   r,  g`3@gDlpf?gݓ?)r>   r      gͰQo&?ghW!@g|o^}?r,     )r,  r      gA*Ŏ@g      @gA?)	r   r{  r   r   sumr   r   find_nearest_contourr   )xyimgr9   nearest_contourexpected_nearests        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            	      
   \         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)rw  z'Method does not support filled contoursr&   Frx  Nrz  Tr|  r}  r  )r]   r  )r   r{  r   r   r  r   r   r(   r)   r	  r  )r  r  r9   s      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	defaultc                  \   \         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-  r1   N)gh㈵>gh㈵>gh㈵?>   0.251.004.00)
r   rh   add_subplotr   r   	geomspacer6   r7   textsrp   )r   r9   texts      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                    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   )	Rectangler   r   r   r   c              3   <   <"   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
   get_facecolorr  r  r   s   &  r   r  r  c  s*      :841 !//+Q//8   )+Nr|   r      2   )#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$)r   r  r  r   )matplotlib.patchesr  r   r   r6   r   r   r   set_over	set_underchangedlegend_elementsrA   zip)r   r   hr9   artistslabels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                     \         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# )rn   r   r   c              3   j   "   T F)  p\        V\        P                  P                  4      x  K+  	  R # 5ir  )r  mplrt  Line2D)r  r  s   & r   r  /test_contour_legend_elements.<locals>.<genexpr>r  s$     @1z!SYY--..s   13FTc              3   Z   "   T F!  w  r\        VP                  4       V4      x  K#  	  R # 5ir  )r
   	get_colorr  s   &  r   r  r  s  s)      1/41 !++-++/r  Nr|   )r   z#00FF00r   r  )z
$x = 10.0$z
$x = 30.0$z
$x = 50.0$)r   r   r6   r   r   r  rA   r  )r   r   r  r[   r9   r  r  s          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                 `   \         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)r^   rb   r_         @N	algorithm)	r   ri   r   r   r  rX  r(   r)   r	  )r  klassr   r9   s   &&  r   test_algorithm_namer  w  sv     	3*sCj)*A\\!1"//7777]]:&&LL0 '&&&s   :BB-	r  c                 ^   \         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)	r^   rb   r_   r  F)r  r   r  TN)r   ri   r   r   r(   r)   r	  )r  r   s   & r   #test_algorithm_supports_corner_maskr    ss     	3*sCj)*A LLU; IQ>]]:&&LLTB '&&&s   8BB,	contour_all_algorithmsgQ?c            	         . 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   r^   r   )scalesizero  Tr   r  ra  )r  r[   Nr  r  r  r  )r\   r   )r>   r  )r   r   default_rngr!   ro   r   r   normalrq  rr  r  ri   r   r   r  ravelr   r   	set_title)

algorithmsrngr   r   r   r   r   r   r   r  s
             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                  t   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   r_   rb   )nrowsr  T)r   rZ   zSimplest default with labelsNr   r   )r   r   r!   r   r   rh   
subfiguresr   r   r7   r  )r   r   r   rq   rr   r   r   rs   r   figsfr   r   s                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   rR   c           
         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   r_   rb   ra  r[   TrZ   r   z0Single color - positive contours solid (default)N)r[   
linestylesz!Single color - positive contours dashdotr[   r  negative_linestylesr   r   )
r   r   r!   r   r   r   r   r7   r  r  )rR   r   r   r   rq   rr   r   r   rs   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           
         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   r_   rb   ra  r  Tr  z1Single color - negative contours dashed (default)dashedzcontour.negative_linestylez!Single color - negative contours z(using rcParams))r[   r  r  r  Nr   r   )r   r   r!   r   r   r   r   r7   r  r  r   )rR   r   r   r   rq   rr   r   r   rs   r  r  r  r  r  r  r  r/  r  fig4ax4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                  p   \         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  Nrb  )
r   rh   r  get_childrenr   r   r   r6   r7   remove)r   orig_childrenr9   s      r   test_contour_remover    s    		!	!	#BOO%M	BIIbM))&1	2BIIK??---IIK??---r   c                      \         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   r   s      r   test_contour_no_argsr    sQ    llnGCFQFD	y(H	I	I


T
 
J	I	I	Is   A!!A2	c                      \         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   r   )r   )	clip_pathN)r   r   mpatchesCircle	transAxesr   get_clip_path)r   r   r   circler9   s        r   test_contour_clip_pathr    s`    llnGCFQFD__c3ZEF	D	+B)))r   c                  0   \         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# )r]   r   r   N)r>   r>   )FFF)FTF)r   r   rn   )r   r   r5   r   r6   astyperr  r   r   tolistr2   r  ri   r   r  
tricontourtricontourf)r   r   r   ms       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                     \         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   ri   nanr   r   r   r2   )r   s    r   test_all_nanr  6  sN    
266266"RVVRVV$456Ackk!n33@Ar   c                     \         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   r   r1   N)
r   r!   r   r   r   r   r   allsegsallkindsr@   )r   r   r   r9   results        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   r4   )r>   r>   r>   ))darkredr   )r  r   ))rc   r   r   ))r~   r}   r   r{   r   ))T{     )Fr  r  )Tr  N)Fr  N))Gz?NNr  )r  (\@Nr  )r  r  Gz@r  )invalidNr  )solidr  r  dotted)Wr   platformr+   unittestr   	contourpynumpyr   numpy.testingr   r   
matplotlibr  r   r   r   r   matplotlib.colorsr	   r
   r  patchesr  matplotlib.testing.decoratorsr   r   r(   r   r$   markparametrizer   emptyr/   r:   rD   rN   rk   rw   r   machiner   r   r   r   r   r   r   r  r
  r  r  r   r%  r5  r;  rC  rL  backendrP  rV  r\  rl  ru  r  r  rR   contextr  r  r  Mpl2005ContourGeneratorMpl2014ContourGeneratorSerialContourGeneratorThreadedContourGeneratorr  r  r  r  r  r  r  r  r  r  r  r  rO  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   