rL iddlZddlZddlmZddlmZddlm Z ddl m Z ddl mZddlmZddlmZedgdd Zed gdd ej&d k(rdnd dZedgej&d k(rdnddZedgdZdZdZedgdd dZedgddgdd Zed!gdd"Zd#Zy)$N)image_comparison)Path) RendererBase)PathEffectRenderer patheffect1T) remove_textc tj}|jddgddgg|jdddt ddd d d t j dd g}|jjt jdd t jgt j dd g}|jdd|y)Ntest)?r)rz->angle3) arrowstyleconnectionstylelwcenterw linewidth foreground) arrowpropssizeha path_effectsT-) linestyler) pltsubplotimshowannotatedictr withStroke arrow_patchset_path_effectsStrokeNormalgrid)ax1txtpes g/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/matplotlib/tests/test_patheffects.pytest_patheffect1r0s ++-CJJAA ,,vx"&$7?A#G8%1%<%  ! !A# > ?BHHTSrH2 patheffect2mpl20x86_64gQ?)rstyletolctj}tjdj d}|j |d|j |d}|jtjdd g |j|d d }tj|tjdd g y)N)rrnearest) interpolationkcolorsr rrrz%2.0fT)fmtuse_clabeltext) r!r"nparangereshaper#contoursetrr&clabelsetp)ax2arrcntrclblss r/test_patheffect2rL s ++-C ))B-   'CJJs)J, ;;s3; 'DHH<22Q3OPHQ JJtJ >EHHU'22Q>ACDEr1 patheffect3g~jt?)r6c `tjgddd\}|jtjtj gtj dtjddg tj|gd gd d }|jjtjgtjddddddd}tjddtjddg}|j||jj|tjdddtjddd !g}tjjd"d#d$d%d&d'(}|j|y))N)r r rr zo-brO)rztesting$^{123}$r rrr>z Line 1$^2$Tz upper left)fancyboxlocr r z Drop testwhitezcircle,pad=0.1red)boxstylecolor)rVbboxg@r;)blue)shadow_rgbFace)rOxxxxgray)offsethatch facecolorblackg?) edgecolorrarg{Gz?g?z Hatch shadowKir)fontsizeweightva)r!plotr(rSimpleLineShadowr*titler&legend legendPatchwithSimplePatchShadowtextr)get_bbox_patchPathPatchEffectgcf)p1legrnr.ts r/test_patheffect3ru0sp ((?Ea 0CB668%,,.01II"--cJKM **bTM?T| LCOO$$l&H&H&J%KL 88Aq+W&6G ID    =  , ,WV L NB"**2.  & &gV17 9  & &G*- / 0B  tS.2d"  $Arr1zstroked_text.pngc gd}d}tjd}t|D]b\}}|jdd|dzz |dd|d d  }|j t j |d z d t jgd|jdd|jdd|jdy)N)zA B C D E F G H I J K LzM N O P Q R S T U V WzX Y Z a b c d e f g h i jzk l m n o p q r s t u vzw x y z 0123456789z!@#$%^&*()-=_+[]\;'z ,./{}|:"<>?2)rrr r g{Gz?g?gp= ף?leftrrS)rrgrrV)xysfontdict rbrrr off) r!axes enumeraternr(rr)r*set_xlimset_ylimaxis) text_chunks font_sizeaxichunkrns r/test_patheffects_stroked_textrMsKI , Bk*75ww#D.U'-X)2W!FG |22Y^>E G+2246 7 7KK1KK1GGENr1ctjd}tjtd\}|j t j t jg|jj}t j|j|}|jd|jdk(sJy)N)dpir}) r!figurerhranger(rrir*canvas get_rendererrget_path_effectspoints_to_pixels)figrrrenderer pe_renderers r/ test_PathEffect_points_to_pixelsris ** C ((59 CB668%,,.01zz&&(H11 x)K  $ $R (K,H,H,L LL Lr1cRtjd}|jdk(sJy)N)rOr)r_)rSimplePatchShadow_offset)r.s r/test_SimplePatchShadow_offsetrvs$  ' 'v 6B ::  r1 collectiongQ?)r6r5c6tjtjdddtjddd\}}tj|tj|z}t j |}|jtjddd tjd g t j|d D]>}|jtjddg|jdddd@y)Nrr}rrdrbnone )rcrar)rr>rSr<r;r )rrsawtoothrZ)rUrarc)rAmeshgridlinspacesincosr!rDrErrpr)rFr(r&set_bbox)ryrzdatacsrns r/test_collectionr{s ;;r{{1b#. B30G HDAq 66!9rvvay D T BFF$$w&TVWa(*F+ 2g.- |66#AB DE F :F$*, --r1 tickedstrokepngg)\(?)r extensionsr6c ,tjddd\}\}}}tj}t j |ddt jddd g }|j||jd |jd d|jd d|jd dgd dgdt jddgd}tjdd|}dtj|dzzdz}|j||dt jg|j!d}d} tjdd|} tjdd| } tj"| | \} } d| z| zdz }| d| zzdz }d| dzz| z }|j%| | |d gd !}|j't jd"g#|j%| | |d gd$!}|j't jd%d&g#|j%| | |d gd'!}|j't jd(g#|jd d|jd dy))Nr r )rrO)figsizerr ir})anglespacinglength)rarrequalr )rr)labelrerrg333333?g?igMbP?g@g@rOg?rY)r;r<)rr>)rP<)rr)b)r)r!subplotsr unit_circlepatches PathPatchrwithTickedStroke add_patchrrrrhrArrrkrrDrE)rr,rHax3pathpatchnxryrznyxvecyvecx1x2g1g2g3cg1cg2cg3s r/test_tickedstrokersp<<1g>C#sC    D   df%%C-. 0J1 2EMM%HHWLLQLLQHHaVaV3'88?BDE F B Cb!A bffQUmc!AHHQL,I,I,K+LHMJJL B B ;;uc2 &D ;;uc2 &D[[t $FB r6B;  B B;? B bBh B ++b"b1#f+ 5CGG,77cBCGD ++b"b1#f+ 5CGG,77bKLGM ++b"b1#f+ 5CGG,77BCGDLLALLAr1zspaces_and_newlines.pngc ,tj}d}d}|jdd|dddddi }|jdd |ddddd i }|jt j g|jt j gy) Nz z Newline also causes problemsg?g?rrrVsalmon)rrgrrWg?thistle)r!r"rnr(rr*)rs1s2text1text2s r/$test_patheffects_spaces_and_newlinesrs B B )B GGCrh8"!8,  .E GGCrh8"!9-  /E L//123 L//123r1cGddt}ttjg|}|j ddk(sJ|j ddk(sJy)Nc,eZdZfdZddZdZxZS)Ltest_patheffects_overridden_methods_open_close_group..CustomRendererc"t|yN)super__init__)self __class__s r/rzUtest_patheffects_overridden_methods_open_close_group..CustomRenderer.__init__s G  r1cy)Nopen_group overridden)rr{gids r/ open_groupzWtest_patheffects_overridden_methods_open_close_group..CustomRenderer.open_groups*r1cy)Nclose_group overriddenr)rr{s r/ close_groupzXtest_patheffects_overridden_methods_open_close_group..CustomRenderer.close_groups+r1r)__name__ __module__ __qualname__rrr __classcell__)rs@r/CustomRendererrs  + ,r1rr{rr)rrrr*rr)rrs r/4test_patheffects_overridden_methods_open_close_grouprs_,,"<#6#6#8"9>;KLH   s #'> >> >    $(@ @@ @r1)platformnumpyrAmatplotlib.testing.decoratorsrmatplotlib.pyplotpyplotr!matplotlib.patheffects patheffectsrmatplotlib.pathrmatplotlib.patchesrmatplotlib.backend_basesrrr0machinerLrurrrrrrrrr1r/rsD:- $15=/t4353"=/t7+8++-9atE EE E=/+8++-9auFF6%&'(6 M <.d': -; ->"%//d,-4@ 4A 4Ar1