
    
3j!                        S SK r S SKrS SKJrJr  S SKJr  S SK	J
r  S SKJr  S SKJr  S SKJr  S SK	Jr  \" S/SSS	9S
 5       r\" S/SS\ R(                  S:X  a  SOS S9S 5       r\" S/S\ R(                  S:X  a  SOS S9S 5       r\" S/SS9S 5       rS rS r\" S/SSS9S 5       r\" S/SSS	9S 5       r\" S/SSS	9S  5       rS! r\" 5       S" 5       rg)#    N)image_comparisoncheck_figures_equal)Path)RendererBase)PathEffectRendererpatheffect1Tmpl20)remove_textstylec                     [         R                  " 5       n U R                  SS/SS//5        U R                  SSS[	        SSSS	9S
S[
        R                  " SSS9/S9nUR                  R                  [
        R                  " SSS9[
        R                  " 5       /5        [
        R                  " SSS9/nU R                  SSUS9  g )N         test)      ?r   )        r   z->angle3)
arrowstyleconnectionstylelw   centerw	linewidth
foreground)
arrowpropssizehapath_effects   T-)	linestyler    )pltsubplotimshowannotatedictr    
withStrokearrow_patchset_path_effectsStrokeNormalgrid)ax1txtpes      [/home/wildlama/miniconda3/lib/python3.13/site-packages/matplotlib/tests/test_patheffects.pytest_patheffect1r3      s    
++-CJJAA 
,,vx"&$7?A#G8%1%<%<qHK&M %N	  OC OO$$l&9&9AEH'J&2&9&9&;&= > 
!
!A#
>	?BHHTSrH2    patheffect2darwing&1?)r
   r   tolc                  r   [         R                  " 5       n [        R                  " S5      R	                  S5      nU R                  USS9  U R                  USS9nUR                  [        R                  " SSS	9/S
9  U R                  USSS9n[         R                  " U[        R                  " SSS	9/S
9  g )N   )r!   r!   nearest)interpolationkcolorsr   r   r   r    z%2.0fT)fmtuse_clabeltext)r$   r%   nparangereshaper&   contoursetr    r)   clabelsetp)ax2arrcntrclblss       r2   test_patheffect2rM       s     ++-C
))B-


'CJJs)J,;;s3;'DHH<22Q3OPHQJJtJ>EHHU'22Q>AC DEr4   patheffect3{Gz?)r   r7   c            	      f   [         R                  " SS9  [         R                  " / SQSSS9u  n U R                  [        R
                  " 5       [        R                  " 5       /5        [         R                  " S[        R                  " SS	S
9/S9  [         R                  " U /S/SSS9nUR                  R                  [        R                  " 5       /5        [         R                  " SSSSSSS.S9n[        R                  " SSS
9[        R                  " SSS9/nUR                  U5        UR                  5       R                  U5        [        R                  " SSSS 9[        R                  " SS!S"S#9/n[         R                   " 5       R                  S$S%S&S'S(S)S*9nUR                  U5        g )+N      figsize)r   r   r!      r   zo-brV   )r   ztesting$^{123}$r   rr   r?   z
Line 1$^2$Tz
upper left)fancyboxlocr   r   z	Drop testwhitezcircle,pad=0.1red)boxstylecolor)r]   bboxg      @r<   )rS   blue)shadow_rgbFace)rV   xxxxgray)offsethatch	facecolorblackg?)	edgecolorrg   r   rO   g?zHatch shadowK   i  r   )fontsizeweightva)r$   figureplotr+   r    SimpleLineShadowr-   titler)   legendlegendPatchwithSimplePatchShadowtextr,   get_bbox_patchPathPatchEffectgcf)p1legru   r1   ts        r2   test_patheffect3r|   0   s|    JJv
((?Ea
0CB668%,,.0 1II"--cJKM **bTM?T|
LCOO$$l&H&H&J%KL88Aq+W&6GID



=

,
,WV
L
NB"**2.

&
&gV179

&
&G*-/
0B
 		tS.2d" 	 	$Arr4   zstroked_text.png)r   c                     / SQn Sn[         R                  " SS9R                  S5      n[        U 5       H^  u  p4UR	                  SSUS-  -
  US	S
USS.S9nUR                  [        R                  " US-  SS9[        R                  " 5       /5        M`     UR                  SS5        UR                  SS5        UR                  S5        g )N)zA B C D E F G H I J K LzM N O P Q R S T U V WzX Y Z a b c d e f g h i jzk l m n o p q r s t u vzw x y z 0123456789z!@#$%^&*()-=_+[]\;'z,./{}|:"<>?2   rQ   rT   )r   r   r   r   g{Gz?g?gp=
ף?leftr   rZ   )r   rm   r   r]   )xysfontdict
   rh   r   r   r   off)r$   rn   add_axes	enumerateru   r+   r    r,   r-   set_xlimset_ylimaxis)text_chunks	font_sizeaxichunkru   s         r2   test_patheffects_stroked_textr   N   s    K I	F	#	,	,\	:Bk*ww#D.U'-X)2W!F  G 	|22Y^>E G+2246 	7 + KK1KK1GGENr4   c                     [         R                  " SS9n [         R                  " [        S5      5      u  nUR	                  [
        R                  " 5       [
        R                  " 5       /5        U R                  R                  5       n[
        R                  " UR                  5       U5      nUR                  S5      UR                  S5      :X  d   eg )N   )dpir      )r$   rn   ro   ranger+   r    rp   r-   canvasget_rendererr   get_path_effectspoints_to_pixels)figry   rendererpe_renderers       r2    test_PathEffect_points_to_pixelsr   j   s    
**
C
((59
CB668%,,.0 1zz&&(H11
x)K $$R(K,H,H,LLLLr4   c                  P    [         R                  " SS9n U R                  S:X  d   eg )N)rV   r!   )re   )r    SimplePatchShadow_offset)r1   s    r2   test_SimplePatchShadow_offsetr   w   s$    		'	'v	6B::r4   
collectiongMb?)r7   r   c                  .   [         R                  " [         R                  " SSS5      [         R                  " SSS5      5      u  p[         R                  " U 5      [         R                  " U5      -   n[
        R                  " U5      nUR                  [        R                  " SSS	S
9[        R                  " SS9/S9  [
        R                  " USS9 H=  nUR                  [        R                  " SSS9/5        UR                  SSSS.5        M?     g )Nr   r   r   r!   d   rh   none   )ri   rg   r   )r   r?   rZ   r=   r<   r   )r   r   sawtoothr`   )r\   rg   ri   )rB   meshgridlinspacesincosr$   rE   rF   r    rw   r,   rG   r+   r)   set_bbox)r   r   datacsru   s        r2   test_collectionr   |   s    ;;r{{1b#.B30GHDA66!9rvvay D	T	BFF$$w&TVWa(*F + 

2g.|66#AB D E 	F:F$*, 	- /r4   ztickedstroke.pngc                    [         R                  " SSSS9u  nu  p#n[        R                  " 5       n[        R
                  " USS[        R                  " SSSS	9/S
9nUR                  U5        UR                  S5        UR                  SS5        UR                  SS5        UR                  SS/SS/S[        R                  " SSS9/S9  Sn[        R                  " SSU5      nS[        R                  " US-  5      -  S-   n	UR                  XS[        R                  " 5       /S9  UR!                  5         SnSn
[        R                  " SSU5      n[        R                  " SSU
5      n[        R"                  " X5      u  pSU-  U-   S-
  * nUSU-  -   S-
  * nSUS -  -   U-
  nUR%                  XUS/S!S"9nUR'                  [        R                  " SS#9/S$9  UR%                  XUS/S%S"9nUR'                  [        R                  " S&SS'9/S$9  UR%                  XUS/S(S"9nUR'                  [        R                  " SS)9/S$9  UR                  SS5        UR                  SS5        g )*Nr   r   )r   rV   rT   r   r   ir   )anglespacinglength)rg   r   r    equalr   C0      )r   r   )labelr    e   r   r   333333?rR   g?C1i   gMbP?g      @g      @rV   g?r_   )r<   r=   )r   r?   )rW   <   )r   r   )b)r   )r$   subplotsr   unit_circlepatches	PathPatchr    withTickedStroke	add_patchr   r   r   ro   rB   r   r   rr   r   rE   rF   )text_placeholdersr   r/   rI   ax3pathpatchnxr   r   nyxvecyvecx1x2g1g2g3cg1cg2cg3s                        r2   test_tickedstroker      s`   <<1g>C#CDdf%%C-.	0J1 2E MM%HHWLLQLLQHHaVaV4'88?BD E  F 
B
Cb!AbffQUmc!AHHQ\-J-J-L,MHNJJL	B	B ;;uc2&D;;uc2&D [[$FB r6B;	BB;?	B	bBh	B
++bb1#f+
5CGG,77cBCGD
++bb1#f+
5CGG,77bKLGM
++bb1#f+
5CGG,77BCGDLLALLAr4   zspaces_and_newlines.pngc            
      &   [         R                  " 5       n SnSnU R                  SSUSSSSS0S	9nU R                  SS
USSSSS0S	9nUR                  [        R
                  " 5       /5        UR                  [        R
                  " 5       /5        g )Nz	         z
Newline also causes problemsg      ?g      ?r   r   r]   salmon)r   rm   r   r^   g      ?thistle)r$   r%   ru   r+   r    r-   )r   s1s2text1text2s        r2   $test_patheffects_spaces_and_newlinesr      s    	B	B	)BGGCrh8"!8,  .EGGCrh8"!9-  /E	L//123	L//123r4   c                       " S S[         5      n [        [        R                  " 5       /U " 5       5      nUR	                  S5      S:X  d   eUR                  S5      S:X  d   eg )Nc                   8   ^  \ rS rSrU 4S jrSS jrS rSrU =r$ )Ltest_patheffects_overridden_methods_open_close_group.<locals>.CustomRenderer   c                 "   > [         TU ]  5         g N)super__init__)self	__class__s    r2   r   Utest_patheffects_overridden_methods_open_close_group.<locals>.CustomRenderer.__init__   s    Gr4   c                     g)Nopen_group overridden )r   r   gids      r2   
open_groupWtest_patheffects_overridden_methods_open_close_group.<locals>.CustomRenderer.open_group   s    *r4   c                     g)Nclose_group overriddenr   )r   r   s     r2   close_groupXtest_patheffects_overridden_methods_open_close_group.<locals>.CustomRenderer.close_group   s    +r4   r   r   )	__name__
__module____qualname____firstlineno__r   r   r   __static_attributes____classcell__)r   s   @r2   CustomRendererr      s    		+	, 	,r4   r   r   r   r   )r   r   r    r-   r   r   )r   r   s     r2   4test_patheffects_overridden_methods_open_close_groupr      s_    , , "<#6#6#8"9>;KLHs#'>>>>$(@@@@r4   c           
         UR                  5       nU R                  5       n[        R                  " SSS5      n[        R                  " US-  * 5      nUR	                  XES[
        R                  " SSS9/S9u  nUR	                  XESSS	S
9  g )Nr   r!   i  r   )r   r   r`   )re   shadow_color)r   r    r   )r   r]   alpha)add_subplotrB   r   expro   r    rp   )fig_testfig_refax_refax_testr   r   lines          r2   test_simple_line_shadowr     s      "F""$G
B3A
1uALL	))fMO  PED
 KKsK;r4   )sysnumpyrB   matplotlib.testing.decoratorsr   r   matplotlib.pyplotpyplotr$   matplotlib.patheffectspatheffectsr    matplotlib.pathr   matplotlib.patchesr   matplotlib.backend_basesr   r   r3   platformrM   r|   r   r   r   r   r   r   r   r  r   r4   r2   <module>r     sO   
  O  -   $ 1 5 =/t7C3 D3" =/t7"||x7eQ@E@E =/!llh6dA??8 %&g6 76
M 
 <.e7;- <- %&DH/ I/d ,-4wO	4 P	4A" < <r4   