
    EVf                     D   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y)    N)image_comparison)Pathpatheffect1T)remove_textc                     t        j                         } | j                  ddgddgg       | j                  dddt	        ddd	      d
dt        j                  dd      g      }|j                  j                  t        j                  dd      t        j                         g       t        j                  dd      g}| j                  dd|       y )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      j/var/www/html/software/conda/envs/catlas/lib/python3.12/site-packages/matplotlib/tests/test_patheffects.pytest_patheffect1r.   
   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mpl20)r   stylec                     t        j                         } t        j                  d      j	                  d      }| j                  |d       | j                  |d      }|j                  t        j                  dd	      g
       | j                  |dd      }t        j                  |t        j                  dd	      g
       y )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<22Q3OPHQJJtJ>EHHU'22Q>AC DEr/   patheffect3c            	      `   t        j                  g ddd      \  } | j                  t        j                         t        j
                         g       t        j                  dt        j                  dd      g	       t        j                  | gd
gdd      }|j                  j                  t        j                         g       t        j                  ddddddd      }t        j                  dd      t        j                  dd      g}|j                  |       |j                         j                  |       t        j                  ddd      t        j                  ddd !      g}t        j                         j                  d"d#d$d%d&d'(      }|j                  |       y ))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   +   sn   
((?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r/   zstroked_text.pngc                     g d} d}t        j                  d      }t        |       D ]b  \  }}|j                  dd|dz  z
  |dd|d	d
      }|j	                  t        j                  |dz  d      t        j                         g       d |j                  dd       |j                  dd       |j                  d       y )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5ww#D.U'-X)2W!F  G 	|22Y^>E G+2246 	77 KK1KK1GGENr/   c                     t        j                  d      } t        j                  t        d            \  }|j	                  t        j                         t        j                         g       | j                  j                         }t        j                  |j                         |      }|j                  d      |j                  d      k(  sJ y )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9
CB668%,,.0 1zz&&(H11
x)K $$R(K,H,H,LLLLr/   c                  R    t        j                  d      } | j                  dk(  sJ y )N)rK   r   )r[   )r   SimplePatchShadow_offset)r,   s    r-   test_SimplePatchShadow_offsetr   p   s$    		'	'v	6B::r/   
collectiongQ?)tolr2   c                  6   t        j                  t        j                  ddd      t        j                  ddd            \  } }t        j                  |       t        j                  |      z   }t        j                  |      }|j                  t        j                  ddd	
      t        j                  d      g       t        j                  |d      D ]>  }|j                  t        j                  dd      g       |j                  dddd       @ y )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   s    ;;r{{1b#.B30GHDAq66!9rvvay D	T	BFF$$w&TVWa(*F + 

2g. -|66#AB D E 	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
      }|j                  |       |j                  d       |j                  dd       |j                  dd       |j                  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   }|j                  ||dt        j                         g       |j!                          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
  }|j%                  |||dgd !      }|j'                  t        j                  d"      g#       |j%                  |||dgd$!      }|j'                  t        j                  d%d&      g#       |j%                  |||dgd'!      }|j'                  t        j                  d(      g#       |j                  dd       |j                  dd       y ))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      sp    <<1g>C#sCDdf%%C-.	0J1 2E MM%HHWLLQLLQHHaVaV3'88?BD E  F 
B
Cb!AbffQUmc!AHHQL,I,I,K+LHMJJL	B	B ;;uc2&D;;uc2&D [[t$FB r6B;	BB;?	B	bBh	B
++b"b1#f+
5CGG,77cBCGD
++b"b1#f+
5CGG,77bKLGM
++b"b1#f+
5CGG,77BCGDLLALLAr/   zspaces_and_newlines.pngc            
      ,   t        j                         } d}d}| j                  dd|dddddi	      }| j                  dd
|dddddi	      }|j                  t	        j
                         g       |j                  t	        j
                         g       y )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23	L//12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3 53" =/t7CE DE =/" #6 %&' (6
M 
 <.d':- ;- >"%//d ,-4@	4 A	4r/   