o
    iR                     @   s   d dl Zd dlmZ d dlmZ d dlmZ	 edgdddd Z
edgdd	d
dd Zedgdd Zedgdd Zdd Zdd Zedgdd	ddd ZdS )    N)image_comparisonpatheffect1T)remove_textc                  C   s   t d} | ddgddgg | jdddtdd	dd
ddtjdddgd}|jtj	dddt
 g tjdddg}| jdd|d d S )No            test)      ?r
   )g        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pe r*   \/var/www/edux/Edux_v2/venv/lib/python3.10/site-packages/matplotlib/tests/test_patheffects.pytest_patheffect1   s$   

r,   patheffect2mpl20)r   stylec                  C   s   t d} tdd}| j|dd | j|dd}t j|jt	j
dd	d
gd | j|ddd}t j|t	j
dd	d
gd d S )Nr      )r   r   nearest)interpolationkcolorsr   r   r   r   z%2.0fT)fmtuse_clabeltext)r   r   nparangereshaper   contoursetpcollectionsr   r!   clabel)ax2arrcntrclblsr*   r*   r+   test_patheffect2   s   

rD   patheffect3c                  C   s  t jg dddd\} | t t g t jdtjdddgd	 t j| gd
gddd}|j	t
 g t jdddddddd}tjdddtj
dddg}|| | | tjddddtjddd d!g}t  jd"d#d$d%d&d'd(}|| d S ))N)r   r   r      r   zo-brF   )r   ztesting$^{123}$r   rr   r6   z
Line 1$^2$Tz
upper left)fancyboxlocr   r   z	Drop testwhitezcircle,pad=0.1red)boxstylecolor)rM   bboxg      @r3   )   blue)shadow_rgbFace)rF   xxxxgray)offsethatch	facecolorblackg?)	edgecolorrX   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legre   r)   tr*   r*   r+   test_patheffect3,   s:   

rl   zstroked_text.pngc               
   C   s   g d} d}t g d}t| D ]&\}}|jdd|d  |dd|d	d
d}|tj|d ddt g q|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   rJ   )r   r^   r   rM   )xysfontdict
   rY   r   r   r   off)r   axes	enumeratere   r#   r   r$   r%   set_xlimset_ylimaxis)text_chunks	font_sizeaxichunkre   r*   r*   r+   test_patheffects_stroked_textH   s"   	r   c                  C   sh   t jdd} t td\}|t t g | j	 }t
| |}|d|dks2J d S )N   )dpirs      )r   figurer_   ranger#   r   r`   r%   canvasget_rendererPathEffectRendererget_path_effectspoints_to_pixels)figri   rendererpe_rendererr*   r*   r+    test_PathEffect_points_to_pixelsd   s   

r   c                  C   s   t jdd} | jdksJ d S )N)rF   r   )rV   )r   SimplePatchShadow_offset)r)   r*   r*   r+   test_SimplePatchShadow_offsetq   s   r   
collectiongQ?)tolr/   c                  C   s   t t dddt ddd\} }t | t | }t|}tjddd	d
tj	ddg}|j
D ]}|| q2tj|ddD ]}|tjdddg |dddd qAd S )Nr   rs   r   r   d   rY   none   )rZ   rX   r   )r   rJ   r4   r3   r   )r   r   sawtoothrQ   )rL   rX   rZ   )r9   meshgridlinspacesincosr   r<   r   rg   r$   r>   r#   r?   r!   set_bbox)ro   rp   datacsr)   r   re   r*   r*   r+   test_collectionv   s$   $





r   )numpyr9   matplotlib.testing.decoratorsr   matplotlib.pyplotpyplotr   matplotlib.patheffectspatheffectsr   r,   rD   rl   r   r   r   r   r*   r*   r*   r+   <module>   s     



