+
    i*                     ,   ^ RI t ^ RIt^ RIHt ^ RIHtHtHt ^ RI	t	^ RI
HtHtHtHtHtHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt R tR t R t!R t"]! R.RR7      R 4       t#R t$R t%]	PL                  PO                  R4      R 4       t(R t)R t*]	PL                  PW                  ]PX                  ! R4      '       * RR7      R 4       t-]	PL                  PW                  ]PX                  ! R4      '       * RR7      R 4       t.R t/R t0R  t1R# )!    N)assert_array_almost_equal)featuresImageTiffTags)collectionspatheffectspyplot
transformsrcParams
rc_context)RendererAgg)Figure)imread)Path)image_comparison)IdentityTransformc                     \        ^R.4      p V P                  R4       V P                  P                  R4       \        P
                  ! 4       pV P                  VV P                  4       RR7       VP                  ^ 4       V P                  VV P                  4       RR7       VP                  ^ 4       \        \        \        V4      R,          4      R	^R7       R# )
   皙?      ?none)	facecolor	edgecolor)decimalN)r   r   r   r   r   )              ?r   r   )r   set_facecolorpatch	set_alphaioBytesIOsavefigget_facecolorseekr   tupler   )figbufs     y/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/matplotlib/tests/test_agg.pytest_repeated_save_with_alphar*      s     !S
Ck"II **,CKK++-   " HHQKKK++-   " HHQKeF3K$564&')    c            
      .   \         P                  ! 4       p \        P                  ! 4       w  r\        P
                  ! \        R^.^
^.^
R.RR.R^..4      .4      pVP                  V4       VP                  R^4       \        P                  ! V 4       R# )
   NigMbP?)
r!   r"   pltsubplotsr   PathCollectionr   
add_artistset_xlimr#   )bufffax
collections       r)   !test_large_single_path_collectionr8   3   s}    ::<D
 LLNEA++	Qx"a2r(S"IQx@	ABDJMM*KKKKr+   c                     \         P                  ! ^4      w  rRp\        P                  ! V4      pVP	                  V4       VP                  W3R,          VR,          4       \        P                  ! 4       pV P                  VRR7       R# )r   i  g?g333333?pngformatN)	r/   r0   nparangesemilogxfill_betweenr!   r"   r#   )r'   r6   stepsdatar(   s        r)   test_marker_with_nanrC   A   sc     ll1oGCE99UDKKOODs(DH-
**,CKKEK"r+   c                     \         P                  ! 4       p \        4       pVP                  4       p\        P
                  ! R 4      pVR;;,          R,          uu&   VP                  V4       VP                  V RR7       R# )順 NN   r:   r;   N)r!   r"   r   r0   r=   onesplotr#   )r4   r'   r6   pointss       r)   test_long_pathrL   M   sV    ::<D
(C	BWWWF
3K2KGGFOKKUK#r+   zagg_filter.pngT)remove_textc                    aaaa R  oRV3R llo ! R R4      p  ! R RV 4      o ! V3R lRV 4      o ! VV3R lR	V 4      p\         P                  ! 4       w  r#VP                  . RO. RORRR^^^
RR7	      w  pVP                  . RO. RORRR^^^
RR7	      w  pV! ^4      pWE3 F  pVP                  4       pVP	                  4       p	VP                  W4      w  p
V
P                  V4       \        P                  ! VP                  4       VRRRR7      pV
P                  V4       V
P                  VP                  4       R
,
          4       V
P                  V4       V
P                  R4       K  	  VP                  RR4       VP                  RR4       VP                   P#                  R4       VP$                  P#                  R4       R# )c                 ^   \         P                  ^V ^ ,          ,          W^R1,          ,
          V ^V R,          ,          V RV) R1,          ,
          3,          p\         P                  ! V4      p\         P                  ! W3P	                  4       ,          VRR7      pWA^,
          V) ^,            # )rG   same)moderH   )r=   r_hanningconvolvesum)x
window_lenswys   &&   r)   smooth1d!test_agg_filter.<locals>.smooth1dY   s    EEadFQ!B''AaeGaJ;r8I6J,JJLJJz"KK%%'	162Azk!m,,r+   c                    < \        \        V4      ^4      ^,          ^,           p\        P                  ! S^ W4      p \        P                  ! S^W4      p V #    )maxintr=   apply_along_axis)AsigmarW   r[   s   && r)   smooth2d!test_agg_filter.<locals>.smooth2da   sJ    UQ'!+a/
!Q;!Q;r+   c                   2   a  ] tR t^gt o R tR tR tRtV tR# )#test_agg_filter.<locals>.BaseFilterc                    ^ # )r    selfdpis   &&r)   get_pad+test_agg_filter.<locals>.BaseFilter.get_padi   s    r+   c                    \        R 4      h)z"Should be overridden by subclasses)NotImplementedError)rl   
padded_srcrm   s   &&&r)   process_image1test_agg_filter.<locals>.BaseFilter.process_imagel   s    %&JKKr+   c                    V P                  V4      p\        P                  ! WV3W33R.R4      pV P                  WB4      pWS) V) 3# )r   constantr   )rn   r=   padrs   )rl   imrm   rw   rr   	tgt_images   &&&   r)   __call__,test_agg_filter.<locals>.BaseFilter.__call__o   sO    ,,s#C3Z#V$D *,J**:;IdSD((r+   rj   N)	__name__
__module____qualname____firstlineno__rn   rs   rz   __static_attributes____classdictcell____classdict__s   @r)   
BaseFilterrh   g   s     		L	) 	)r+   r   c                   6   a  ] tR t^vt o RR ltR tR tRtV tR# )%test_agg_filter.<locals>.OffsetFilterc                    Wn         R # Noffsets)rl   r   s   &&r)   __init__.test_agg_filter.<locals>.OffsetFilter.__init__x   s    "Lr+   c                Z    \        \        V P                  4      ^H,          V,          4      # )H   )ra   r`   r   rk   s   &&r)   rn   -test_agg_filter.<locals>.OffsetFilter.get_pad{   s     s4<<(2-344r+   c                    V P                   w  r4\        P                  ! V\        V^H,          V,          4      ^R7      p\        P                  ! V\        V^H,          V,          4      ) ^ R7      pV# )r   )axis)r   r=   rollra   )rl   rr   rm   oxoya1a2s   &&&    r)   rs   3test_agg_filter.<locals>.OffsetFilter.process_image~   sS    \\FBSb3%7a@Bc"r'C-00q9BIr+   r   N)r   	r|   r}   r~   r   r   rn   rs   r   r   r   s   @r)   OffsetFilterr   v   s     	#	5	 	r+   r   c                   B   <a  ] tR t^t o RtRR ltR tV3R ltRtV t	R# )'test_agg_filter.<locals>.GaussianFilterzSimple Gaussian filter.c                *    Wn         W n        W0n        R # r   )rd   alphacolor)rl   rd   r   r   s   &&&&r)   r   0test_agg_filter.<locals>.GaussianFilter.__init__   s    JJJr+   c                V    \        V P                  ^,          ^H,          V,          4      # r^   )ra   rd   rk   s   &&r)   rn   /test_agg_filter.<locals>.GaussianFilter.get_pad   s    tzz!|b(3.//r+   c                   < \         P                  ! V4      pV P                  VR&   S! VR,          V P                  ,          V P                  ^H,          V,          4      VR&   V# )NNN)r   r   :Nr_   N)r   r   r_   )r=   
empty_liker   r   rd   )rl   rr   rm   ry   re   s   &&& r)   rs   5test_agg_filter.<locals>.GaussianFilter.process_image   sU    j1I"&**Ih!)*W*=

*J*.**r/C*?"AIgr+   )r   r   rd   N)      ?r   r   r   )
r|   r}   r~   r   __doc__r   rn   rs   r   r   )r   re   s   @r)   GaussianFilterr      s     %	
	0	 	r+   r   c                   @   <a  ] tR t^t o RVV3R lltR tR tRtV tR# ))test_agg_filter.<locals>.DropShadowFilterc                >   < S! WV4      V n         S! V4      V n        R # r   gauss_filteroffset_filter)rl   rd   r   r   r   r   r   s   &&&&&r)   r   2test_agg_filter.<locals>.DropShadowFilter.__init__   s     .uU CD!-g!6Dr+   c                ~    \        V P                  P                  V4      V P                  P                  V4      4      # r   )r`   r   rn   r   rk   s   &&r)   rn   1test_agg_filter.<locals>.DropShadowFilter.get_pad   s6    t((005))11#68 8r+   c                r    V P                   P                  W4      pV P                  P                  W24      pV# r   )r   rs   r   )rl   rr   rm   t1t2s   &&&  r)   rs   7test_agg_filter.<locals>.DropShadowFilter.process_image   s3    ""00AB##11":BIr+   r   N)g333333?r   r   r   )r   r   r   s   @r)   DropShadowFilterr      s     	7 	7	8	 	r+   r   r   zbo-brY   zLine 1)mecmfclwmewmslabelzro-rg      @rK   )rV   rZ   unitsTr   r   FNr^   )皙?r   ?)r   r   r   )r   g?gffffff?g      )r/   r0   rJ   	get_xdata	get_ydataupdate_frommtransformsoffset_copyget_transformset_transform
set_zorder
get_zorderset_agg_filterset_rasterizedr3   set_ylimxaxisset_visibleyaxis)r   r   r'   r6   line1line2gausslinexxyyshadow	transformr   r   r[   re   s               @@@@r)   test_agg_filterr   W   s   -) )z  $ :  llnGC WW_ou#!r  KFEWW_ou#!r  KFE QE ^^^^''"/4   ++ #HF	Y' 	$//+c12e$d## & KKBKKBHHHHr+   c                      \         P                  ! RR7      p \        P                  ! 4       p\        P
                  ! \        4      ;_uu_ 4        V P                  V4       RRR4       R#   + '       g   i     R# ; i),  )figsizeN)r   i   )r/   figurer!   r"   pytestraises
ValueErrorr#   )r'   r4   s     r)   test_too_large_imager      sE    
**\
*C::<D	z	"	"D 
#	"	"	"s   A++A<	c                     \        ^4      p \        P                  ! 4       w  rVP                  V \        P
                  ! V 4      4       VP                  P                  4        \        P                  ! 4       w  r^i\        R&   VP                  V \        P
                  ! V 4      4       VP                  P                  4        R# )   agg.path.chunksizeN)	ranger/   r0   rJ   r=   sincanvasdrawr   )rV   r'   r6   s      r)   test_chunksizer      s|    c
A llnGCGGArvvayJJOO llnGC%(H!"GGArvvayJJOOr+   Aggc                      \         P                  ! . RO. RO4       \        P                  ! 4       p \         P                  ! V R^R7       \
        P                  ! V 4      pVP                  R,          R8X  g   Q hR# )r   jpg)r<   rm   rm   Nr   r   rG   r   r   r   )r   r   )r/   rJ   r!   r"   r#   r   openinfor(   rx   s     r)   test_jpeg_dpir      sP     HHY	"
**,CKKEs+	CB775>Z'''r+   c                      ^ RI Hp  \        P                  ! 4       pV ! 4       pVP	                  RR4       \
        P                  ! 4       P                  VRRV/R7       \        P                  ! V4      pVP                  R,          R8X  g   Q hR# )r   )PngInfoSoftwaretestr:   pnginfor<   
pil_kwargsN)PIL.PngImagePluginr   r!   r"   add_textr/   r   r#   r   r   r   )r   r(   r   rx   s       r)   test_pil_kwargs_pngr      sk    *
**,CiGZ(JJLU	77KL	CB77:&(((r+   c                  x   \         P                  ! 4       p R R/p\        P                  ! 4       P	                  V RVR7       \
        P                  ! V 4      pVP                  P                  4        UUu/ uF'  w  r4\        P                  V,          P                  VbK)  	  pppVR,          R8X  g   Q hR# u uppi )descriptionz
test imagetiffr   ImageDescriptionN)r!   r"   r/   r   r#   r   r   tag_v2itemsr   TAGS_V2name)r(   r   rx   kvtagss         r)   test_pil_kwargs_tiffr	     s    
**,C.JJJLV
C	CB46IIOO4EF4EDAHQ$$a'4EDF"#|333 Gs   4-B6webpzWebP support not available)reasonc                     \         P                  ! . RO. RO4       \        P                  ! 4       p R^/p\         P                  ! V RVR7       \        V4      ^8X  g   Q h\        P                  ! 4       pR^d/p\         P                  ! VRVR7       \        V4      ^8X  g   Q hVP                  4       P                  V P                  4       P                  8  g   Q hR# )r   qualityr
  r   Nr   r   )r/   rJ   r!   r"   r#   len	getbuffernbytes)	buf_smallpil_kwargs_low	buf_largepil_kwargs_highs       r)   test_pil_kwargs_webpr     s    HHY	"

I^NKK	&^D~!###

I #&OKK	&_E1$$$ '')*=*=*?*F*FFFFr+   c                      \         P                  ! . RO. RO4       \        P                  ! 4       p \         P                  ! V RRR7       \
        P                  ! V 4      pVP                  R8X  g   Q hR# )r   r
  T)r<   transparentRGBANr   r   )r/   rJ   r!   r"   r#   r   r   rQ   r   s     r)   test_webp_alphar  
  sJ    HHY	"
**,CKKF5	CB77fr+   c                  B   \         P                  ! 4       w  rVP                  ^.^.4      P                  \	        RR.4      4       \
        P                  ! \        4      ;_uu_ 4        V P                  P                  4        RRR4       R#   + '       g   i     R# ; i)r   N)r   r   )rG   r_   )
r/   r0   scatter	set_pathsr   r   r   	TypeErrorr   r   )r'   r6   s     r)   (test_draw_path_collection_error_handlingr    sb    llnGCJJsQC""4(8#9:	y	!	!

 
"	!	!	!s   (BB	c            
      B   R p Rp^V,          p^V,          p\         P                  ! ^ W 4      p\         P                  ! V 4      V,          p^ VR&   \        \         P                  ! WE34      P
                  4      p^ Vn        \        W#V4      pVP                  4       pVP                  ^4       VP                  R4       VP                  R4       \        P                  ! \        RR7      ;_uu_ 4        VP                  W\!        4       4       RRR4       VP                  R4       \        P                  ! \        RR7      ;_uu_ 4        VP                  W\!        4       R4       RRR4       \#        R	^ /4      ;_uu_ 4        \        P                  ! \        R
R7      ;_uu_ 4        VP                  W\!        4       4       RRR4       RRR4       \#        R	R/4      ;_uu_ 4        \        P                  ! \        RR7      ;_uu_ 4        VP                  W\!        4       4       RRR4       RRR4       \#        R	R/4      ;_uu_ 4        \        P                  ! \        RR7      ;_uu_ 4        VP                  W\!        4       4       RRR4       RRR4       RVn        \        P                  ! \        RR7      ;_uu_ 4        VP                  W\!        4       4       RRR4       R#   + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL[; i  + '       g   i     ELg; i  + '       g   i     EL; i  + '       g   i     EL*; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)rE   i  rF   r   /zcannot split hatched path)matchNzcannot split filled pathr   z
Please seti@B zPlease reducei_ Fzshould_simplify is False)r   r   r   )r=   linspacerI   r   vstackTsimplify_thresholdr   new_gcset_linewidthset_foreground	set_hatchr   r   OverflowError	draw_pathr   r   should_simplify)	Nrm   rY   hrV   rZ   pathragcs	            r)   test_chunksize_failsr2    sv    	A
C	#A	#A 	AqA

QAAcF		1&!##$DD 
Q3	B	BQcLL	},G	H	H
R023 
ILL	},F	G	G
R02I> 
H 
)1-	.	.]]===LL#4#67 > 
/
 
)95	6	6]]=@@LL#4#67 A 
7
 
)62	3	3]]=@@LL#4#67 A 
4 !D	},F	G	G
R023 
H	G/ 
I	H	H 
H	G	G
 >== 
/	.	. A@@ 
7	6	6 A@ 
4	3
 
H	G	Gs   4K/L%L+*L	L+*%ML?	*M%M:4M'	M:
N/L 	L	L("	L++L<	?M
	MM$	'M72M::N
	N	c                      \         P                  ! 4       p V P                  R R7      P                  . RO. RO\        P
                  ! ^R7      .R7       V P                  P                  4        R# )3d)
projection)	linewidth)path_effectsNr   )r/   r   add_subplotr  r   Stroker   r   )r'   s    r)   test_non_tuple_rgbafacer:  O  sO    
**,COOtO$,,9K,>,>,K+L - NJJOOr+   )2r!   numpyr=   numpy.testingr   PILr   r   r   r   
matplotlibr   r   r	   r/   r
   r   r   r   matplotlib.backends.backend_aggr   matplotlib.figurer   matplotlib.imager   matplotlib.pathr   matplotlib.testing.decoratorsr   matplotlib.transformsr   r*   r8   rC   rL   r   r   r   markbackendr   r   r	  skipifcheckr  r  r  r2  r:  rj   r+   r)   <module>rI     s    	  3 ) )   8 $ #   : 3)>	#$ #$$7n  8n b U( ()4 v..7ST
G U
G v..7ST U24jr+   