rL i81LddlmZddlmZddlZddlZddlZddlZddl Z ddl m Z m Z m Z mZddlmZddlmZddlmZmZddlmZmZddl ZddlmZddlmZddl m!Z"e jFjId e jFjKd d d ge jFjKdddge jFjKdddifddddifddddifddddifddifddddifddddifggddZ&dZ'eedZ(ed gd!Z)eed gd"Z*d#Z+ed$Z,ed%Z-ed&Z.ed'gd(Z/ed)gd*Z0ed+gd,Z1edg-d.Z2ed/Z3ed0gd12d3Z4e jFjKd4d5d6gd7Z5d8Z6d9Z7d:Z8ed;gd<=d>Z9ed?gd@=dAZ:edBgdCZ;edDgdEdFid1GdHZ||-.&8($EKKM999$ 555/0CLL4O$/;$>H=F(=R1E9-&(2%???2e;;; 3S%@3S%@ gu5555o767676** " KKC ! ! " ** " KKC ! ! "2)* " KKC ! ! ")76767676sK&$*L%9N*B1N*M$*D*NN*&L"9LL"%M!8MM!$N2NNNNN' #N**N3c"tjddgtjd<t j \}}|j gdtj5}|j|ddddy#1swYyxYw)Nw) linewidth foregroundz path.effects)r#r$rrr%) r withStroker*r+r2r3r8r4r6r=)rHrIrs rRtest_patheffectsr[tsms;$=CLL llnGCGGI % Bt $%%%s (BBcR|dz }|jtjtt |5dt j d<tjgdtjdtj|dz d dddy#1swYyxYw) Nzshort-1)tempdirTr)r#r$rrUz\textbf{time} (s)z tex_demo.epsrrY) mkdirr _setattr_cmtempfiler1r*r+r2r8xlabelr=)tmp_path base_tempdirs rRtest_tilde_in_tempfilenamerd}s i'L   8S-> ?@&* ]#  '( L>1$? @@@s ABB&z empty.epsctj\}}|j|jddgdd|j dddddy)Nrr#rcoloralpha?foo)r2r3 set_axis_offr8textrHrIs rRtest_transparencyrosGllnGCOOGGQF#QG'GGBEAG.r(cdtjd<tj\}}|j |j ddgdd|j dddddy) NTrrr#rfrgrjrk)r*r+r2r3rlr8rmrns rRtest_transparency_texrqsW#'CLLllnGCOOGGQF#QG'GGBEAG.r(c Ptj\}}tj5}|j |d|j }dddt jdt j}|sJt jd|t j}|sJtddD]b}d|j|vsJt|j|tjt|j|dk(rbJy#1swYxYw)NrrYs$^%%BoundingBox: (.+) (.+) (.+) (.+)$s)^%%HiResBoundingBox: (.+) (.+) (.+) (.+)$r#.)r2r3r4r6r=r@rCsearch MULTILINErangegroupintr/approxfloat)rHrIbufbbhibbis rR test_bboxrsllnGC  C &lln :C NB I2 99A3\\ #D K4 1a[J288A;&&&288A;6==tzz!}1Eq#IIIIJs $DD%cdtjd<tjdt j t 5tjtjddddy#1swYyxYw)z"Test failing latex subprocess callTrz$22_2_2$rrYN) r*r+r2rar/raisesr;r=r4r6r(rRtest_failing_latexrsS#'CLLJJz | $/ BJJL.///s *A55A>c |jdtjddddtjddddtjt j d |j \}d |jvsJy) NWARNING皙?rkT)usetex皙?barrrYzas if usetex=False) set_levelr2figtextr=r4r6records getMessage)caplogrecords rRtest_partial_usetexrsj YKKBd+KKBd+KK T*nnGF 6#4#4#6 66 6r(ctjjdddtjdddtj t jdy)NTz$\usepackage{color,graphicx,textcomp})rztext.latex.preamblerjrkrrY)r*r+r,r2rr=r4r6)rs rRtest_usetex_preamblersELLF KKBKK T*r(z useafm.epscdtjd<tj\}}|j |j d|j dddy)NTrrjqk)r*r+r2r3rlaxhlinermrns rR test_useafmrsD $CLLllnGCOOJJrNGGBDr(z type3.epsc2tjdddy)NrjzI/J)r2rrr(rRtest_type3_fontrsKKBr(zcoloredhatcheszerolw.epsc tj}|jtddddddd|jtdd d d dd d |jtd dddddd|j y)N)rrr#/nonerfr)hatch facecolor edgecolorrW)rjrjrj+gr)r#r#g333333?g?\b)r2gca add_patchr rl)rIs rR!test_colored_hatch_zero_linewidthrs} BLLASF#&!56LLS#SF#&#78LLc#&!56OOr() extensionsc|j}|jddd|jd|jy)NrhelloT) transformclip_on) add_subplotrm transFigure)fig_testfig_refrIs rRtest_text_cliprs8    BGGAq'X%9%94GH r(ctj}|jddd|dz }|j|tj j j|dy)Nrjdefztest.epsF)cache)r2rrmr=r*testingcompareconvert)rbrHouts rR test_d_glyphrsR **,CHHRU Z CKKKK51r(ztype42_without_prep.epsmpl20)stylec~dtjd<dtjd<tjdddy)N* ps.fonttypestixzmathtext.fontsetrjzMass $m$)r*r+r2rrr(rRtest_type42_font_without_preprs1#%CLL'-CLL#$KKS*%r(fonttype342c^|tjd<tj\}}|j dddt j }|j|ddt|d zd z}tj||jtjsJy) Nrg?rjz&Forty-two is the answer to everything!rrYs /FontType zutf-8)encodings def) r*r+r2r3rmr4r6r=bytesrCrur@rv)rrHrIr|tests rR test_fonttyper s"*CLLllnGCGGD#?@ **,CKKDK! 5H:A AG KD 99T3<<>2<< 88 8r(ctj\}}|jddgdtj}|j |d|j dkDsJy)z-Test that dashed lines do not break PS outputrr#z--) linestylerrYN)r2r3r8r4r6r=tell)rHrIr|s rR test_linedashrsRllnGCGGQFdG# **,CKKDK! 88:>>r(ct}|jdddtj}|j |d|j |dy)Nrjz foo rrYr)r rmr4r6r=)rr|s rRtest_empty_liner$sD XF KKS+& **,C NN3uN% NN3tN$r(c,t}|jddtd}|jD](}|j gg|j ddg*|j dtj}|j|d |jd |jDcgc]'}|jd r|jd d )}}tt|j!dk(sJycc}w)NrUpolar) projection) subplot_kw)xticksyticksr#r$z hello, worldrrYrr )r r3dictflatsetr8suptitler4r5r=seek readlines startswith partitionmaxrvalues)rHaxsrIr|lnwdss rRtest_no_duplicate_definitionr-s (C ,,q!(@, AChh b$ ALL ++-CKKEK"HHQK " mmC  << Q  "C " ws|""$ % ** *  "s;,Dzmulti_font_type3.epsgRQ?)tolcbtjdg}ttj|jdk7rt j dtjdddgdtjd d tj}|jd d dy)NWenQuanYi Zen Heifamilywqy-zenhei.ttcFont may be missingfont DejaVu Sansrsizerrr333333?ffffff?"There are 几个汉字 in between! fmFontPropertiesrfindfontnamer/r0r2rcrrmfprHs rRtest_multi_font_type3rAs  #6"7 8B BKKO!!%55 )*FF6=*=>RHFF4! **,CHHT5>?r(zmulti_font_type42.epsg?cbtjdg}ttj|jdk7rt j dtjdddgdtjd d tj}|jd d dy)Nrrrrrrrrrrrrrrrrs rRtest_multi_font_type42rNs  #6"7 8B BKKO!!%55 )*FF6=*=>RHFF4" **,CHHT5>?r(z scatter.epscptjjd}|jddd}|jddd}|jddd}t j \}}|j |||gdd |jtd d Dcgc]!}tjj|#}}|jdd d jdd}ddg}tj||dd|} |j| |j!ddycc}w)Ni!N,rr# d)g?rr<)rmarkerrr$g{Gz?g{Gz?yellow)zorder facecolorsoffsets)nprandom default_rnguniformr2r3scatterrlrwrrunit_regular_polygonreshape mcollectionsPathCollectionadd_collectionset_xlim) rngxvalsyvalssizesrHrIrpathsr pcs rRtest_path_collectionr[s  ))   )C KK1b !E KK1b !E KKC $EllnGCJJueUocJJOO8=a D1TYY + +A . DE Dkk!S"%--b!4G 4LE  $ $UE"08' KBbKK1 Es&&D3zcolorbar_shift.eps bbox_inchestight) savefig_kwargrctjgd}tjgd|j}t j ddgddgddg||t j y)N)rfrr)rgrjr#rr#)ccmapnorm)mcolorsListedColormap BoundaryNormNr2rcolorbar)rbr#r$s rRtest_colorbar_shiftr*msT  ! !/ 2D    2DFF ;DKKAA1a&t$?LLNr(c^tj}tjtd5|j t jdddddtjtd5dtjd<dddy#1swYAxYw#1swYyxYw)Nz'auto' is not a valid value)matchrauto)r%r&z ps.papersize) r2rr/r ValueErrorr=r4r6r*r+)rHs rRtest_auto_papersize_removalr/vs **,C z)F GB BJJL& AB z)F G.'- ^$..BB..s'B:B#B #B,)> collectionsrpathlibrr4rCr`numpyr r/ matplotlibrrrrrmatplotlib.figurer matplotlib.patchesr matplotlib.testing._markersr r matplotlib.testing.decoratorsr rr*matplotlib.collectionsrmatplotlib.colorscolorsr%matplotlib.pyplotpyplotr2markflaky parametrizerSr[rdrorqrrrrrrrrrrrrrrrrrr*r/rr(rRr@s/  CC$&GO-#!x&:;[(AB4 5" 5$m45 5$f-. 5=$'( E2 D;%& EM4()7"G6#C<(G6T%@@";- /!/;- /!/J$//77++<.!";- !-./0()22,-W=&>&c4[1 92 9 %+()*5 @6 @*+5 @6 @=/"#"'(8P!!.r(