
    ^j!                        d dl Z d dlZd dlmZm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 d dl	mZ  edgdd	      d
        Z edgdd e j(                         dk(  rd nd      d        Z edgd e j(                         dk(  rd nd      d        Z edgd      d        Zd Zd Z edgdd      d        Z edgdd	      d        Z edgdd	      d         Zd! Z e       d"        Zy)#    N)image_comparisoncheck_figures_equal)Path)RendererBase)PathEffectRendererpatheffect1Tmpl20)remove_textstylec                     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      l/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/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x86_64g&1?)r
   r   tolc                     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       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            	         t        j                  d       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      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                     g d} d}t        j                  d      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   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* 75ww#D.U'-X)2W!F  G 	|22Y^>E G+2246 	77 KK1KK1GGENr4   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   )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                  R    t        j                  d      } | j                  dk(  sJ y )N)rV   r!   )re   )r    SimplePatchShadow_offset)r1   s    r2   test_SimplePatchShadow_offsetr   w   s$    		'	'v	6B::r4   
collectiongMb?)r7   r   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   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HDAq66!9rvvay D	T	BFF$$w&TVWa(*F + 

2g. -|66#AB D E 	F:F$*, 	--r4   ztickedstroke.pngc           
      ,   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   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      sn   <<1g>C#sC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 [[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r4   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   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                       G d dt               } t        t        j                         g |              }|j	                  d      dk(  sJ |j                  d      dk(  sJ y )Nc                   ,     e Zd Z fdZddZd Z xZS )Ltest_patheffects_overridden_methods_open_close_group.<locals>.CustomRendererc                 "    t         |           y N)super__init__)self	__class__s    r2   r   zUtest_patheffects_overridden_methods_open_close_group.<locals>.CustomRenderer.__init__   s    Gr4   c                      y)Nopen_group overridden )r   r   gids      r2   
open_groupzWtest_patheffects_overridden_methods_open_close_group.<locals>.CustomRenderer.open_group   s    *r4   c                      y)Nclose_group overriddenr   )r   r   s     r2   close_groupzXtest_patheffects_overridden_methods_open_close_group.<locals>.CustomRenderer.close_group   s    +r4   r   )__name__
__module____qualname__r   r   r   __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           	      *   |j                         }| j                         }t        j                  ddd      }t        j                  |dz         }|j	                  ||dt        j                  dd      g      \  }|j	                  ||ddd	
       y )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	1))fMO  PED
 KK1sK;r4   )platformnumpyrB   matplotlib.testing.decoratorsr   r   matplotlib.pyplotpyplotr$   matplotlib.patheffectspatheffectsr    matplotlib.pathr   matplotlib.patchesr   matplotlib.backend_basesr   r   r3   machinerM   r|   r   r   r   r   r   r   r   r  r   r4   r2   <module>r     s_     O  -   $ 1 5 =/t7C3 D3" =/t7+8++-9auFEFE =/+8++-9atEE8 %&g6 76
M 
 <.e7;- <- %&DH/ I/d ,-4wO	4 P	4A" < <r4   