+
    i:                        R t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIt^ RI	H
t
 ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHtHt R	 t]P@                  PC                  ^R
7      R 4       t"R t#R t$]! R.RRR7      R 4       t%R t&R t'R t(R t)]! R.R]PT                  ! 4       R8X  d   ^ MRR7      R 4       t+]! R>R7      R 4       t,R t-R t.]! R .RR!]PT                  ! 4       R8X  d   ^ MR"R#7      R$ 4       t/]! R%.RR&7      R' 4       t0R( t1]! R).R*R+7      R, 4       t2R- t3]! R.R7      R. 4       t4]P@                  Pk                  R/R0R1.4      ]! R>R7      R2 4       4       t6R3 t7R4 t8]! R5.RR!R67      R7 4       t9]! R.R7      R8 4       t:R9 t;]! R.R7      R: 4       t<]! R.R7      R; 4       t=R< t>R= t?R# )?z%
Tests specific to the lines module.
N)SimpleNamespace)cycler)assert_array_equal)_path)MarkerStyle)Path)image_comparisoncheck_figures_equalc            	         RRr\         P                  ! RR.4      \         P                  ! RR.4      r2Rp\        \        P                  ! WW#V4      ^ .4       R# )zTest a problematic case.i)  i  g     H@g     W@g     @g(\@N)nparrayr   mlinessegment_hits)cxcyxyradiuss        {/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/matplotlib/tests/test_lines.pytest_segment_hitsr      sJ    #88T4L!288S$K#8qFv**21@1#F    )rerunsc                 :   Rp \         P                  ! ^ ^V 4      p\         P                  P                  V R7      p\        P
                  ! 4       p\        P                  ! 4       p\        P                  ! W4      pVP                  R4       \        \        P                  ! VP                  P                  ^^R7      4      pVP                  V4       \        \        P                  ! VP                  P                  ^^R7      4      pWv,          p^p	W8  g   Q hR# )aG  
GitHub issue #1256 identified a bug in Line.draw method

Despite visibility attribute set to False, the draw method was not
returning early enough and some pre-rendering code was executed
though not necessary.

Consequence was an excessive draw time for invisible Line instances
holding a large number of points (Npts> 10**6)
sizeF)numberrepeatNi )r   linspacerandomnormalpltfiguresubplotr   Line2Dset_visiblemintimeitr   canvasdrawadd_line)
Nr   r   figaxl	t_no_linet_invisible_lineslowdown_factorslowdown_thresholds
             r   test_invisible_Line_renderingr2   $   s     	A
Aq!A
		a A **,C	B 	aAMM%
 FMM#**//!AFGI KKN 6==1MN '2O///r   c                      \         P                  ! 4       w  r\        P                  P	                  ^ 4       VP                  \        P                  P                  ^^4      R.R7       R#     )
linestylesNr5   )   r8   r    subplotsr   r   seedcontourrandnr+   r,   s     r   test_set_line_coll_dashr?   P   sB    llnGCIINN1 JJryyr2&K=JAr   c                     \         P                  ! \        R R7      ;_uu_ 4        \        P                  ! ^ . 4       RRR4       \         P                  ! \        RR7      ;_uu_ 4        \        P                  ! . ^4       RRR4       \        P                  ! . . 4      p \         P                  ! \        RR7      ;_uu_ 4        V P                  ^ 4       RRR4       \         P                  ! \        RR7      ;_uu_ 4        V P                  ^ 4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Lv; i  + '       g   i     R# ; i)zxdata must bematchNzydata must bez	x must bez	y must be)pytestraisesRuntimeErrorr   r#   	set_xdata	set_ydatalines    r   test_invalid_line_datarJ   X   s    	|?	;	;a 
<	|?	;	;b! 
< ==R D	|;	7	7q 
8	|;	7	7q 
8	7 
<	;	;	; 
8	7	7	7	7s/   D)D1EED.	1E	E	E(	line_dashesTg~jth?)remove_texttolc                  n    \         P                  ! 4       w  rVP                  \        ^
4      R^R7       R# )
   )	linestylelwNr7   )r    r:   plotranger>   s     r   test_line_dashesrT   e   s'     llnGCGGE"IG3r   c                     \         P                  ! 4       w  rVP                  \        ^
4      RR7       VP                  \        ^
4      RR7       VP                  \        ^
4      RR7       VP                  \        ^
4      RR7       VP                  \        ^
4      RR7       V P                  P                  4        R# )rO   none)colorrz.3N)   r5   r5   rY   )rY   r5   r5   r    r:   rR   rS   r'   r(   r>   s     r   test_line_colorsr[   n   s    llnGCGGE"IVG$GGE"ISG!GGE"ITG"GGE"I\G*GGE"IYG'JJOOr   c                      \         P                  ! . . 4      p \        P                  ! \        4      ;_uu_ 4        V P                  R 4       RRR4       R#   + '       g   i     R# ; ifoobarN)r   r#   rC   rD   
ValueError	set_colorrH   s    r   test_valid_colorsra   x   s<    ==R D	z	"	"x  
#	"	"	"   AA'	c                      \         P                  ! 4       w  rR RRRRRRRR
R^ . 33 F  pVP                  \        ^
4      VR	7       K!  	  V P                  P                  4        R# )-solid--dashedz-.dashdot:dottedN)rP   )r5   N)r5    rZ   )r+   r,   lss      r   test_linestyle_variantsrm   ~   s^    llnGCGT8YX'Ar7 	b	R(	
 JJOOr   c                      \         P                  ! . . 4      p \        P                  ! \        4      ;_uu_ 4        V P                  R 4       RRR4       R#   + '       g   i     R# ; i)aardvarkN)r   r#   rC   rD   r_   set_linestylerH   s    r   test_valid_linestylesrq      s>    ==R D	z	"	":& 
#	"	"	"rb   zdrawstyle_variants.pngx86_64gQ?c                      \         P                  ! ^4      w  r. ROp\        VP                  V4       F4  w  r4VP	                  \        R4      VR7       VP                  RRR7       K6  	  R# )   N  	drawstyle)xlimylim)defaultz	steps-mid	steps-prez
steps-poststepsN)r5      )r    r:   zipflatrR   rS   set)r+   axsdssr,   dss        r   test_drawstyle_variantsr      sU     ||AHC
LC
 chh$
dr*
F( %r   png)
extensionsc                 4   V P                  4       p\        P                  ! R 4      pVP                  VR ,           V4       VP                  4       p\        P
                  ! 4       P                  RR4      pVP                  W3WBP                  ,           R7       R# )ru   g     @@        )	transformN)add_subplotr   arangerR   mtransformsAffine2D	translate	transData)fig_reffig_testr,   r   ts   &&   r   test_no_subslice_with_transformr      sn    				B
		$AGGAHa				B((5AGGAAllNG+r   c                      \         P                  ! . . 4      p \        P                  ! \        4      ;_uu_ 4        V P                  R 4       RRR4       R#   + '       g   i     R# ; ir]   )r   r#   rC   rD   r_   set_drawstylerH   s    r   test_valid_drawstylesr      s>    ==R D	z	"	"8$ 
#	"	"	"rb   c                     \         P                  ! ^ ^\         P                  ,          ^
4      p \         P                  ! V 4      p\        P
                  ! 4       w  r#VP                  W4      w  pVP                  R4       \        VP                  4       P                  4      ^\        V 4      ,          ^,
          8X  g   Q hVP                  R4       \        VP                  4       P                  4      \        V 4      8X  g   Q hR# )r5   r{   rz   N)r   r   pisinr    r:   rR   r   lenget_pathvertices)r   r   r+   r,   rI   s        r   test_set_drawstyler      s    
Aqw#A
q	AllnGCGGAMED{#t}}''(Ac!fHQJ666y!t}}''(CF222r   line_collection_dashesmpl20g?)rL   stylerM   c                      \         P                  ! 4       w  r\        P                  P	                  ^ 4       VP                  \        P                  P                  ^^4      R.R7       R# r4   r9   r>   s     r   test_set_line_coll_dash_imager      sB     llnGCIINN1JJryyr2&K=JAr   zmarker_fill_styles.png)rL   c                  n   \         P                  ! . RORRRRR\        P                  ! . RO4      .4      p Rp\        P                  ! ^^.4      p\        P                  ! ^ ^	.4      p\        P
                  ! 4       w  rE\        R4       F  w  rg\        \        P                  P                  4       FU  w  r\        V 4      p
VP                  V^
,          V,           W(,           RV^,          ,          ,           V^VV	V	^V
V
^R	7       KW  	  K  	  VP                  ^ R
.4       VP                  R^.4       R# )r5   gz#ff0000cmr   
lightgreenzov^<>8sp*hHDdPX      ?)	marker
markersizemarkerfacecoloralt	fillstylelabel	linewidthrW   markeredgecolormarkeredgewidthg      @Nr5   r5   rY   )r5   r5   r5   )	itertoolscycler   r   r    r:   	enumerater   r#   
fillStylesnextrR   set_ylimset_xlim)colorsaltcolorr   r   r+   r,   jr   ifsrW   s              r   test_marker_fill_stylesr      s   __iic3 hhy13 4FH
!QA
!QAllnGC 01	v}}778EALEGGAFQJa!e 4!!'/ $)$%  	' 9 2 KKCKKS	r   c                     \         P                  ! . RO\        RRR7      RR7      w  p V P                  4       R8X  g   Q hV P	                  4       R8X  g   Q hR# )z=Test that markerfacecolor does not override fillstyle='none'.orV   )r   red)r   markerfacecolorNrY   r8   r}   )r    rR   r   get_fillstyleget_markerfacecolor)r-   s    r   test_markerfacecolor_fillstyler      sL    	)Kv$F"'
)BA??&&&  "f,,,r   scaled_linesrz   )r   c            	         \         P                  ! ^ ^ 4      p \        P                  ! 4       w  r. ROp\	        \
        P                  R,          4      p\        \        W44      4       Fg  w  pw  rg\         P                  ! R^
^
4       FC  pVP                  ! W\         P                  ! ^24      ,          RV,          ,           3RVRV/VB  KE  	  Ki  	  R# )r5   axes.prop_cycler   皙?rP   rQ   N)rg   rj   rh   )r   r   r    r:   r   
matplotlibrcParamsr   r~   rR   ones)	thr+   r,   lins_stylesr   r   rl   styrQ   s	            r   test_lw_scalingr      s    	Q	BllnGC1K	
##$56	7B!#k"679B++b"b)BGGB"''"+R/L2L"LL * 8r   c                     \         P                  ! \        P                  ! . RO4      4      '       g   Q h\         P                  ! \        P                  ! ^\        P                  ^.4      4      '       g   Q h\         P                  ! ^^.\        P                  .^d,          ,           ^ ^.,           4      '       d   Q h\         P                  ! \        P                  ! RR.R4      4      '       d   Q h^\
        P                  P                  ,          p \        P                  ! \        P                  .V ,          \        V 4      4       R# )rY   i   i   z>i4NrY   r}   r8   )r   is_sorted_and_has_non_nanr   r   nanr   r#   _subslice_optim_min_sizer    rR   rS   )ns    r   test_is_sorted_and_has_non_nanr      s    **288I+>????**288QN+CDDDD..1v3/F!Q/OPPPP..rxx58I5/QRRRR	FMM222AHHbffX\58$r   c                     V P                  4       P                  ^ ^.R4       VP                  4       P                  . RO. ROR^ ^.R7       R# )r5   z-o	markeveryNr   )r5   rY   rY   )r:   steprR   r   r   s   &&r   test_step_markersr      sC    aVT*Iy$1a&Ir   parentr!   axesc                 "  a aaa \         P                  P                  ^*4       \         P                  ! ^ ^^4      p\         P                  P	                  \        V4      4      pR^R. RO^ R.\        ^^
^4      \         P                  ! \        V4      4      VR8  ,          RR.	p. ROpVR8X  d   VRR pVRR pV 3R lpV3R lpM]VR8X  dW   \        S P                  ^^4      P                  4      o\        SP                  ^^4      P                  4      oV3R lpV3R	 lpV F  p	X! W4V	R
7       K  	  V FR  p	\         P                  ! \        V	4      4      P                  \        4      P                  \        4      p
X! W4V
R
7       KT  	  R# )*   Nr   333333?r!   c          	      X   < SP                  \        P                  ! WR VR7      4       R# r   r   r   N
add_artistr   r#   )r   r   r   r   s   &&$r   add_test test_markevery.<locals>.add_test  s"    a3)DFr   c          	      X   < SP                  \        P                  ! WR VR7      4       R# r   r   )r   r   r   r   s   &&$r   add_reftest_markevery.<locals>.add_ref  s"    a3)DFr   r   c                B   < \        S4      P                  WR VR7       R# z-gDr   Nr   rR   )r   r   r   axs_tests   &&$r   r   r   %  s    NeyAr   c                B   < \        S4      P                  WR VR7       R# r   r   )r   r   r   axs_refs   &&$r   r   r   (  s    MqUi@r   r   )r}      )rY   r      )r   皙?)	111111111111111000100010001000100001000010010001000001001000000000000100000101010000011100011101101101101101111001010011011101)r   r   r;   r   randr   slicer   iterr:   r   r   listastypeintbool)r   r   r   r   r   
cases_test	cases_refr   r   casemer   r   s   ff&        @@r   test_markeveryr    sT    IINN2
Aq"A
		s1vA6:b'5B?))CF#AG,z#JGI _
crN		F	F 
6	))!Q/445w''1-223	B	A &  XXd4j!((-44T:# r   c            	      <   \         P                  ! 4       p V P                  \        P                  ! ^ ^.^ ^.RRR7      4       \
        P                  ! \        4      ;_uu_ 4        V P                  P                  4        RRR4       R#   + '       g   i     R# ; i)r5   r   r   r   N)
r    r!   r   r   r#   rC   rD   r_   r'   r(   )r+   s    r   .test_markevery_figure_line_unsupported_relsizer  3  s\    
**,CNN6==!Q!QrJK	z	"	"

 
#	"	"	"s   %B

B	c                     \         P                  ! 4       w  rVP                  . RO\        R4      R7      w  pV P                  P                  4        VP                  4       R8X  g   Q hVP                  R4       V P                  P                  4        VP                  \        R4      4       V P                  P                  4        \        P                  ! RR.^R.^ ^..4      pVP                  . R	O\        V4      ^R7      w  pVP                  . R
OV^R7      w  p\        VP                  4       P                  VP                  4       \        VP                  4       P                  VP                  4       R# )r}   D)r   sr   )r   msN)r}      r8   r   r   )r5   r}   rY   )r    r:   rR   r   r'   r(   
get_marker
set_markerr   _create_closedr   r   )r+   r,   rI   	triangle1line2line3s         r   test_marker_as_markerstyler  :  s   llnGCGGIk#&6G7EDJJOO??### 	OOCJJOOOOK$%JJOO##b"X2wA$?@IWWY{9'="WEFEWWYyRW8FEu'')22I4F4FGu'')22I4F4FGr   zstriped_line.png)rL   r   c            
      4   \         P                  P                  R 4      p \        P                  ! 4       w  rVP                  V P                  ^R7      RRR^RR7       VP                  V P                  ^R7      RRR^RR	R
7       VP                  ^R7       R# )i!N,r   orangebluerf    )rW   gapcolorrP   rQ   r   r   blackr   )rW   r!  rP   rQ   r   alpha)handlelengthN)r5   )r}   r   r  r}   )r   r   default_rngr    r:   rR   uniformlegend)rng_r,   s      r   test_striped_linesr*  N  s    
))


)CLLNEAGGCKKRK 6q  -GGCKKRK 'AS  EII1Ir   c                     V P                  4       P                  ^^.. ROR7       VP                  4       P                  ^^.. ROR7       R# )rY   )dashesNr   )rY   r}   r8   rY   r}   r8   )r   rR   r   s   &&r   test_odd_dashesr-  Y  sC    Ay91v.@Ar   c                     \         P                  ! 4       w  r\        V P                  P                  ^,          V P                  P
                  ^,          ^,           R7      pVP                  ^ ^.^ ^.RR7      w  pVP                  V4      w  rEV'       d   Q hVP                  ^ ^.^ ^.R^R7      w  pVP                  V4      w  rEV'       g   Q h\        VR,          ^ .4       VP                  ^ ^.^ ^.RR7      w  pVP                  V4      w  rEV'       d   Q hVP                  ^4       VP                  V4      w  rEV'       g   Q h\        VR,          ^ .4       R# )r}   )r   r   T)picker)r/  
pickradiusindN)
r    r:   r   bboxwidthheightrR   containsr   set_pickradius)r+   r,   mouse_eventl0foundindicesl1l2s           r   test_pickingr=  _  s+   llnGC!CHHNNa$7$'HHOOq$82$=?K ''1a&1a&'
.CB[[-NE9 ''1a&1a&"'
=CB[[-NEL5wu~s+ ''1a&1a&'
.CB[[-NE9b[[-NEL5wu~s+r   c                    \         P                  ! ^ ^^4      pV P                  4       P                  W"R4      w  p\	        ^4      VR&   VP                  R4       VP                  4       P                  . RO. RORRR7       R# )r5   z.-:NNNr|   rv   N)r5   r}   r  )r   r   r   rR   rS   r   )r   r   r   r-   s   &&  r   test_input_copyr?  y  sl     			!QA					$	$Q4	0BA8AaDOOGy)TWMr   c                F   R^R. RO^ R.\        ^d^^4      RRRRR.p\        P                  R,          pV! \        P                  ! RR\        V4      4      4      p\        P                  ! R^4      p^V^,          ,          pVP                  4       p\        V4       F&  w  rVP                  Wh,
          RWV,          R	7       K(  	  \        VVR	7      \        P                  R
&   V P                  4       p
\        V4       F  w  rV
P                  Wh,
          R4       K  	  R# )z*Test that we can set markevery prop_cycle.Nr   r   g      ?jet皙?皙?zo-)r   rW   r   )      )      rD  r   )r   r   )g?r   )r  mpl	colormapsr   r   r   r   r   rR   r   r   r   )r   r   casescmapr   r   r   r   r   r   r,   r)  s   &&          r   test_markevery_prop_cyclerL    s     1g|aW3Qc3&E ==D"++c3E
34F
BA	AqDA



C!%(	C ) .4e:@.BJ)* 
			B% 
t !r   c                  n   \         P                  ! 4       w  rVP                  RRR7      pVP                  RR4      pVP                  R4       VP	                  R4       VP                  R4       VP                  R4       VP                  4       R8X  g   Q hVP                  4       R8X  g   Q hVP                  4       R8X  g   Q hVP                  4       R8X  g   Q h\        P                  ! \        P                  4      ;_uu_ 4        VP                  RR4       RRR4       \        P                  ! \        P                  4      ;_uu_ 4        VP                  RR4       RRR4       \        P                  ! \        RR	7      ;_uu_ 4        VP                  RR4       RRR4       \        P                  ! \        R
R	7      ;_uu_ 4        VP	                  ^4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Lv; i  + '       g   i     R# ; i)r   333333?sloperC  rB  r   g333333@Nz.Cannot set an 'xy2' value while 'slope' is setrA   z-Cannot set a 'slope' value while 'xy2' is set)r   r   )rC  r   )rB  r   )r   rB  )rN  rC  )r    r:   axlineset_xy1	set_slopeset_xy2get_xy1	get_slopeget_xy2rC   warnsrH  MatplotlibDeprecationWarningrD   r_   )r+   r,   line1r  s       r   test_axline_settersr[    s   llnGCIIhcI*EIIh)E 
MM(	OOC	MM(	MM( ==?h&&&??###==?h&&&==?h&&&	c66	7	7b" 
8	c66	7	7b" 
8 
zM
O 
Ob"
O 
zL
N 
N
N 
N 
8	7	7	7
O 
O
N 
N 
Ns0   	G*G=HH#*G:	=H	H 	#H4	c                    \         P                  ! RRR7      p V P                  4       P                  R4      pV P                  4       P                  R4      pV^,          V^,          ,
          pV^ 8  g   Q hVR8  g   Q hR# )z@Test that small slopes are not coerced to zero in the transform.g+=rO  g-=N)r5   r5   )rY   rY   )r    rQ  get_transformtransform_point)rI   p1p2dys       r   test_axline_small_sloperb    sl    ::fE*D					-	-f	5B					-	-f	5B	AAB6M6::r   )r   )@__doc__r   platformr&   typesr   r   numpyr   numpy.testingr   rC   r   rH  r   matplotlib.lineslinesr   matplotlib.markersr   matplotlib.pathr   matplotlib.pyplotpyplotr    matplotlib.transforms
transformsr   matplotlib.testing.decoratorsr   r	   r   markflakyr2   r?   rJ   rT   r[   ra   rm   rq   machiner   r   r   r   r   r   r   r   r   r   parametrizer  r  r  r*  r-  r=  r?  rL  r[  rb  rk   r   r   <module>ru     sr      !   ,     ! *    + OG !(0 (0VB
 =/t?4 @4!' +,$#++-9atE	)E	) ), *,%
3 +,$g#++-9atEBEB +,$? @>- >")4M 5M% (J )J
 Hf#56))$ * 7)$XH( %&DH I (B )B
,4 (N )N ( )0>r   