
    (?e                        d dl Zd dlmZ d dlmZ d dlmZ	 d dl
mZ d dlmZ  edgd          d             Z edgdd	
          d             Z edg          d             Z edg          d             Zd Zd Z edgdd	          d             Z edgddgd          d             Z edgd          d             ZdS )    N)image_comparison)Pathpatheffect1T)remove_textc                     t          j                    } |                     ddgddgg           |                     dddt	          ddd	          d
dt          j        dd          g          }|j                            t          j	        dd          t          j
                    g           t          j        dd          g}|                     dd|           d S )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      Alib/python3.11/site-packages/matplotlib/tests/test_patheffects.pytest_patheffect1r.   
   s   
+--CJJAA   
,,vx"&$7?A#G #G #G8%1%<qHK&M &M &M %N	  O OC O$$l&9AEH'J 'J 'J&2&9&;&;&= > > > 
!A#
>
>
>	?BHHTSrH22222    patheffect2mpl20)r   stylec                     t          j                    } t          j        d                              d          }|                     |d           |                     |d          }|                    t          j	        dd	          g
           | 
                    |dd          }t          j        |t          j	        dd	          g
           d S )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       r-   test_patheffect2rH      s     +--C
)B--


'
'CJJs)J,,,;;s3;''DHH<2Q3OOOPHQQQJJtJ>>EHU'2Q>AC C C DE E E E E Er/   patheffect3c            	      v   t          j        g ddd          \  } |                     t          j                    t          j                    g           t          j        dt          j        dd          g	           t          j        | gd
gdd          }|j	                            t          j
                    g           t          j        ddddddd          }t          j        dd          t          j
        dd          g}|                    |           |                                                    |           t          j        ddd          t          j        ddd !          g}t          j                                        d"d#d$d%d&d'(          }|                    |           d S ))N)r   r
   r      r
   zo-brK   )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)rR   bboxg      @r7   )   blue)shadow_rgbFace)rK   xxxxgray)offsethatch	facecolorblackg?)	edgecolorr]   r   g{Gz?g?zHatch shadowK   i  r   )fontsizeweightva)r   plotr&   r   SimpleLineShadowr(   titler$   legendlegendPatchwithSimplePatchShadowtextr'   get_bbox_patchPathPatchEffectgcf)p1legrj   r,   ts        r-   test_patheffect3rq   +   s   
(???Ea
0
0
0CB688%,..0 1 1 1I"-cJJJKM M M M *bTM?T|
L
L
LCO$$l&H&J&J%KLLL8Aq+W&6GGI I ID


=
=
=

,WV
L
L
L
NB"**2...

&gV179 9 9

&G*-/ / /
0B
 			tS.2d" 	 	$ 	$Arr/   zstroked_text.pngc                     g d} d}t          j        d          }t          |           D ]h\  }}|                    dd|dz  z
  |dd|d	d
          }|                    t          j        |dz  d          t          j                    g           i|                    dd           |	                    dd           |
                    d           d S )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   )r   r   r   r   g{Gz?g?gp=
ף?leftr   rO   )r   rc   r   rR   )xysfontdict
   r^   r   r   r   off)r   axes	enumeraterj   r&   r   r'   r(   set_xlimset_ylimaxis)text_chunks	font_sizeaxichunkrj   s         r-   test_patheffects_stroked_textr   G   s     K I	,		Bk** 7 75ww#D.U'-X)2W!F !F  G G 	|2Y^>E G  G  G+2446 	7 	7 	7 	7 KK1KK1GGENNNNNr/   c                     t          j        d          } t          j        t          d                    \  }|                    t          j                    t          j                    g           | j        	                                }t          j
        |                                |          }|                    d          |                    d          k    sJ d S )N   )dpiry      )r   figurerd   ranger&   r   re   r(   canvasget_rendererPathEffectRendererget_path_effectspoints_to_pixels)figrn   rendererpe_renderers       r-    test_PathEffect_points_to_pixelsr   c   s    
*


C
(599

CB688%,..0 1 1 1z&&((H1
x) )K $$R((K,H,H,L,LLLLLLLr/   c                  J    t          j        d          } | j        dk    sJ d S )N)rK   r   )r[   )r   SimplePatchShadow_offset)r,   s    r-   test_SimplePatchShadow_offsetr   p   s.    		'v	6	6	6B:r/   
collectiongQ?)tolr2   c                  8   t          j        t          j        ddd          t          j        ddd                    \  } }t          j        |           t          j        |          z   }t          j        |          }|                    t          j	        ddd	
          t          j
        d          g           t          j        |d          D ]E}|                    t          j        dd          g           |                    dddd           Fd S )Nr   ry   r   r   d   r^   none   )r_   r]   r   )r   r:   rO   r8   r7   r
   )r   r   sawtoothrV   )rQ   r]   r_   )r=   meshgridlinspacesincosr   r@   rA   r   rl   r'   rB   r&   r$   set_bbox)ru   rv   datacsrj   s        r-   test_collectionr   u   s3   ;r{1b#..B30G0GHHDAq6!99rvayy D	T		BFF$w&TVWWWa(((*F + + + 
2g... - -|6#AB D  D  D E 	F 	F 	F:F$*, , 	- 	- 	- 	-- -r/   tickedstrokepngg)\(?)r   
extensionsr   c            
         t          j        ddd          \  } \  }}}t          j                    }t	          j        |ddt          j        ddd	          g
          }|                    |           |	                    d           |
                    dd           |                    dd           |                    ddgddgdt          j        dd          g           d}t          j        dd|          }dt          j        |dz            z  dz   }|                    ||dt          j                    g           |                                 d}d}	t          j        dd|          }
t          j        dd|	          }t          j        |
|          \  }}d|z  |z   dz
   }|d|z  z   dz
   }d|dz  z   |z
  }|                    |||dgd !          }|                    t          j        d"          g#           |                    |||dgd$!          }|                    t          j        d%d&          g#           |                    |||dgd'!          }|                    t          j        d(          g#           |
                    dd           |                    dd           d S ))Nr   r
   )r   rK   )figsizer   r	   iry   )anglespacinglength)r]   r   r   equalr          )r   r   )labelr   e   r   r   g333333?   g?i   gMbP?g      @g      @rK   g?rU   )r7   r8   )r   r:   )rL   <   )r   r   )b)r   )r   subplotsr   unit_circlepatches	PathPatchr   withTickedStroke	add_patchr   r}   r~   rd   r=   r   r   rg   r   r@   rA   )r   r*   rD   ax3pathpatchnxru   rv   nyxvecyvecx1x2g1g2g3cg1cg2cg3s                       r-   test_tickedstroker      s    <1g>>>C#sCDdf%C-.	0 	0 	0J1 2 2 2E MM%HHWLLQLLQHHaVaV3'8?BD D D E  F F F 
B
Cb!!AbfQUmmc!AHHQL,I,K,K+LHMMMJJLLL	B	B ;uc2&&D;uc2&&D [t$$FB r6B;	BB;?	B	bBh	B
++b"b1#f+
5
5CGG,7cBBBCGDDD
++b"b1#f+
5
5CGG,7bKKKLGMMM
++b"b1#f+
5
5CGG,7BBBCGDDDLLALLAr/   zspaces_and_newlines.pngc            
      H   t          j                    } d}d}|                     dd|dddddi	          }|                     dd
|dddddi	          }|                    t	          j                    g           |                    t	          j                    g           d S )Nz	         z
Newline also causes problemsg      ?g      ?r   r   rR   salmon)r   rc   r   rS   g      ?thistle)r   r    rj   r&   r   r(   )r   s1s2text1text2s        r-   $test_patheffects_spaces_and_newlinesr      s    	B	B	)BGGCrh8"!8,  . .EGGCrh8"!9-  / /E	L/112333	L/11233333r/   )numpyr=   matplotlib.testing.decoratorsr   matplotlib.pyplotpyplotr   matplotlib.patheffectspatheffectsr   matplotlib.pathr   matplotlib.patchesr   r.   rH   rq   r   r   r   r   r   r    r/   r-   <module>r      s       : : : : : :       - - - - - -             $ $ $ $ $ $ =/t4443 3 543" =/t7CCCE E DCE =/""  #"6 %&''  ('6
M 
M 
M     
 <.d':::- - ;:- >"%  / / /d ,-4@@@	4 	4 A@	4 	4 	4r/   