rL i$|ddlmZddlZddlZddlZddlZddlmZddl Z ddl m Z m Z ddlZddlZddlmZddlmZGddZGddZGd d ZGd d ZGd dZGddZGddZGddZGddZGddZ GddZ!GddZ"GddZ#Gdd Z$Gd!d"Z%Gd#d$Z&Gd%d&Z'Gd'd(Z(Gd)d*Z)Gd+d,Z*Gd-d.Z+d/Z,ejZj]d0gd1d2Z/Gd3d4Z0d5Z1d6Z2d7Z3d8Z4d9Z5d:Z6d;Z7d<Z8ejZj]d=d>d?Z9ejZj]d@dAdBge jtdCgdDZ;ejZj]dEgdFejxj{dGdHZ>dIZ?ejZj]dJejdKejdLfdMZBdNZCy)O) nullcontextN)parse)assert_almost_equalassert_array_equalc "eZdZddejgdfddejgdfddejgd fd d ej d d zfdd ej ddd zfgZdddejgdfdddejgdfddgdejgdfgZejjdedZ ejjdedZ ejjddd ie ejd fd!d"dgied#fd!d"ied#fd!d"d$gied#fgd%Zejjd&gd'gd'fd"d(ggd'fdd"ggd'fd"ggd'fgd)Zy)*TestMaxNLocatord)4@gD@gN@gT@Y@MbP?-C6?)g-C6*?g-C6:?ga2U0*C?g-C6J?r 4&k 4&k C)rg4&krg4&kBrrg&q5gLog5g&q皙皙?N)rrffffff?)gпr????7)r?r )r-<vmin, vmax, expectedchtjd}t|j|||y)Nr nbinsmticker MaxNLocatorr tick_values)selfvminvmaxexpectedlocs b/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/matplotlib/tests/test_ticker.py test_basiczTestMaxNLocator.test_basic s'!!*COOD$7Bzvmin, vmax, steps, expectedcltjdd|}t|j|||y)Nr T)r)integerstepsr*)r.r/r0r8r1r2s r3 test_integerzTestMaxNLocator.test_integer%s+!!4uECOOD$7Br5zkwargs, errortype, matchfooz5set_params() got an unexpected keyword argument 'foo'r8rz$steps argument must be an increasing ctj||5tjdi|dddy#1swYyxYw)Nmatch)pytestraisesr+r,)r.kwargs errortyper>s r3 test_errorszTestMaxNLocator.test_errors*s8]]9E 2 *    )& ) * * *s 7Az steps, result)rrr!r!cntj|}|j|k(jsJy)N)r8)r+r,_stepsall)r.r8resultr2s r3 test_paddingzTestMaxNLocator.test_padding5s/!!. f$))+++r5)__name__ __module__ __qualname__nparrayarange basic_data integer_datar@mark parametrizer4r9 TypeErrorreescape ValueErrorrDrIr?r5r3rrs S("((567 !LMN hbhhJKL HibiilU*+ AyryyQ'%/0 J sD("((=12 tT8288$DEF B"HBHH-@$ABL  [[3Z@CAC [[:LICJC [[7 Y J K M Aq6 J(NO 1z#IJ Ar7 Z)OP :** [[_ Z R* Q j / ,  ,r5rc$eZdZdZdZdZdZy)TestLinearLocatorctjd}tjgd}t |j dd|y)Nnumticks)皙333333ӿ皙?r^r`)r+ LinearLocatorrMrNrr-r.r2 test_values r3r4zTestLinearLocator.test_basicAs6##Q/XX/0 COOD#6 Cr5cZtjd}|jddgk(y)Nrr\r^r`)r+rar-r.r2s r3test_zero_numticksz$TestLinearLocator.test_zero_numticksFs%##Q/ c"b(r5ctjd}|jddgi|jdk(sJ|jdgik(sJy)z Create linear locator with presets={}, numticks=2 and change it to something else. See if change was successful. Should not exception. rr\rr)r]presetsN)r+ra set_paramsr]rjres r3test_set_paramsz!TestLinearLocator.test_set_paramsJsP ##Q/ FB<8||q   {{vrl***r5cztjgdddgd}|jddgdk(sJ|jddgdk(sJ|jddddgk(sJ|jd d ddgk(sJ|jddtjddd k(j sJy) N)r??rr))rrrr)rjrrrr@r;)r+rar-rMlinspacerGres r3 test_presetszTestLinearLocator.test_presetsTs##_693Z-ABq!$777q!$777q!$c 222sC(S#J6661%Q2)>>CCEEEr5N)rJrKrLr4rfrlrsr?r5r3rYrY@sD )+Fr5rYc6eZdZdZdZdZdZdZdZdZ y) TestMultipleLocatorctjd}tjgd}t |j dd|y)NV- @base)go"V-gV- rrwV-@go"@gV-)@r!r+MultipleLocatorrMrNrr-rbs r3r4zTestMultipleLocator.test_basic_s:%%51XX./ COOB3Z@r5ctjdd}tjgd}t |j dd|y)Nrw333333?ryoffset)gZd{ gK7A`gx&rgSc@g`"@gx&1H%@r|r!r}rbs r3test_basic_with_offsetz*TestMultipleLocator.test_basic_with_offsetes<%%5=XX'( COOB3Z@r5ctjddi5tjd}t |j ddddddy#1swYyxYw) z5 Test basic behavior of view limits. axes.autolimit_modedatarwrxrr )rr Nmpl rc_contextr+r~r view_limitsres r3test_view_limitsz$TestMultipleLocator.test_view_limitsksT^^2F; < A))u5C A 6 @ A A A 3AActjddi5tjd}t |j ddddddy#1swYyxYw) b Test that everything works properly with 'round_numbers' for auto limit. r round_numbersrwrx)rzr{Nrres r3test_view_limits_round_numbersz2TestMultipleLocator.test_view_limits_round_numbersssT ^^2OD E I))u5C A 6 H I I Irctjddi5tjdd}t |j dddd d d y #1swYy xYw) rrrrw?rrr)g`"g}?5^@Nrres r3*test_view_limits_round_numbers_with_offsetz>TestMultipleLocator.test_view_limits_round_numbers_with_offset|sV ^^2OD E I))uSAC A 6 H I I Is 4AActjddi5tjd}t |j ddddddy#1swYyxYw) zM Test that 'round_numbers' works properly with a single bin. rrrr(gffffffgffffff@)rrN)rrr+r,rrres r3test_view_limits_single_binz/TestMultipleLocator.test_view_limits_single_binsT^^2OD E E%%A.C c :G D E E Erctjd}|jd|jjdk(sJ|jd|j dk(sJy)z Create multiple locator with 0.7 base, and change it to something else. See if change was successful. ffffff?rx333333?r[)rN)r+r~rk_edgestep_offset)r.mults r3rlz#TestMultipleLocator.test_set_paramssX &&C0 S!zz#%%% q!||q   r5N) rJrKrLr4rrrrrrlr?r5r3ruru^s+A A AIIE !r5ruc eZdZdZddgZdZejjdedZ gdZ dZ ejjd e d Z gd Z gd gd gdgdgdgdgdgdgZeee eZejjdedZejjdddgejjddgd fdgd fgdZejjdddgejjdddgdfd d!gd"fd#d$gd%fgd&Zy')(TestAutoMinorLocatorctj\}}|jdd|jt j gd}t |jjd|y)Nr= ףp=?皙?皙?g333333?r333333?gffffff??r皙?g?rrg333333??r?rgffffff?rnrg?Tminor) pltsubplotsset_xlim minorticks_onrMrNrxaxis get_ticklocsr.figaxrcs r3r4zTestAutoMinorLocator.test_basics^,,.R At XXGH  BHH111=zJr5rr)rrctj\}}|jdd|jj t j tjgd}t|jjd||jddtjgd}t|jjd|y ) zI Test that first and last minor tick appear as expected. ffffffffffff?) rg333333ggffffffgg333333皙gr^gffffffg333333皙ٿr_皙ɿrrr`r皙?333333?r皙?rrrrgffffff?g?rg?rTrrr )ggg gggrrr@g@ @g@@N) rrrrset_minor_locatorr+AutoMinorLocatorrMrNrrrs r3test_first_and_last_minorticksz3TestAutoMinorLocator.test_first_and_last_minortickss ,,.R D# ""7#;#;#=>XXBC  BHH111=zJ BXXGH BHH111=zJr5z%nb_majorticks, expected_nb_minortickscvtj\}}d}|j||jt j |d|d||j |jjtjt|jj|k(sJy)N)rr rr) rrr set_xticksrMrrrrrr+rlenget_minorticklocs)r. nb_majorticksexpected_nb_minorticksrrxlimss r3test_low_number_of_majorticksz2TestAutoMinorLocator.test_low_number_of_majortickss,,.R U bkk%(E!HmDE  ""7#;#;#=>288--/04JJJJr5))rr )rr)rr )r r )r!r ctjddi5|jDcgc]}|d }}tjj |t jjdddycc}w#1swYyxYw)N_internal.classic_modeFr) rrmajorstep_minordivisionsrMtestingassert_allcloser+ AutoLocatorrF)r.x majorstepss r3"test_using_all_default_major_stepsz7TestAutoMinorLocator.test_using_all_default_major_stepssz ^^5u= > E(,(E(EF1!A$FJF JJ & &z'.':':'<'C'C E E EF E EsA? A:>A?:A??Bz&major_step, expected_nb_minordivisionscNtj\}}d|f}|j||j||j |j j tjt|j jdz}||k(sJyNrr) rrrrrrrr+rrr)r. major_stepexpected_nb_minordivisionsrrrnb_minor_divisionss r3test_number_of_minor_ticksz/TestAutoMinorLocator.test_number_of_minor_tickss,,.RJ U e  ""7#;#;#=> !;!;!=>B!%????r5)rrrgn?)rԍ;)rgVs?=)gH׊gI hG|a)gv !>ҷ>)ʔA{v()g"s2_dglEՎfUr){Gzt?{Gz?Q?g?gQ?gQ?g ףp= ?rg)\(?gp= ף?gQ?g333333?g(\µ?g ףp= ?gRQ?gzG?)\(?gq= ףp??gp= ף?gHzG?)gO ;gO ;gU;g#B ;gU;g̈=;gnP*@;g#B ;gԍ;gaW;g̈=;gmx;gJ;gnP*@;gnXen;g+3M;r)g+ ?7=gQu.U9=gc߯x:=g; ==gU>=)g*#&,gYg#"5Ԉg_eG|gS'цgBY[%gk̈́gv !g|)vgQ؎gqrgƀg%e~gw$}g ߈/|gYygv(xgS'vgv !tgz]rgqrqgw$mgHjgv(hgz]b)gL>gE/w>gZMϢ>gkʹ>g ʧ#>g!+lěN>g:0y>gR>g};h>gBY[%>gqwNP>gʔA{>gS'Ѷ>g>g.W '>gG)R>gxz)e秷>r)g5m/Ggg\+-eqg+i)+gM7܉g%eޮgw$zlim, refctj\}}|j|jdddd|jdddd|j |t |j jd |y) NTryr) linewidthmajork)colorrr)rrrgridset_ylimryaxisr)r.limrefrrs r3test_additionalz$TestAutoMinorLocator.test_additionalsm,,.R  gsa0 gSA6 CBHH111=sCr5 use_rcparamFTrrc2|rddd}i}ni}ddi}tj|5tj\}}|j||j ||j jtjdi||jjtjdi|t|j jd|t|jjd|dddy#1swYyxYw)Nautozxtick.minor.ndivszytick.minor.ndivsnTrr?) rrrrrrrrr+rrrr)r.rrrcontextrBrrs r3test_number_of_minor_ticks_autoz4TestAutoMinorLocator.test_number_of_minor_ticks_autos ,2PGFG6]F ^^G $ HllnGC BKK  BKK  HH & &w'?'?'I&'I J HH & &w'?'?'I&'I J  5 5D 5 A3 G  5 5D 5 A3 G H H Hs CD  Dz n, lim, refr)rr)rrrrrrp)rrrrnrror!ri) rr`rrrrrrrc|r||d}i}ni}d|i}tj|5tj\}}|j||j ||j jtjd|j jtjdi||jjtjd|jjtjdi|t|j jd|t|jjd|dddy#1swYyxYw)NrrrTrr?)rrrrrrrset_major_locatorr+r~rrrrr) r.rrrrrrBrrs r3test_number_of_minor_ticks_intz3TestAutoMinorLocator.test_number_of_minor_ticks_int.s& ,-AFGFG1XF ^^G $ HllnGC BKK  BKK  HH & &w'>'>q'A B HH & &w'?'?'I&'I J HH & &w'>'>q'A B HH & &w'?'?'I&'I J  5 5D 5 A3 G  5 5D 5 A3 G H H Hs D:E))E2N)rJrKrLr4paramsrr@rRrSrrrrlimits referencelistzipadditional_datarrrr?r5r3rrsK F K& [[DfM KN K )E  [[E57 @7 @>F  B  ' '   1 E /I:3vy12O [[Z9D:D [[]UDM: [[ G H" #    H  ;H" [[]UDM: [[ , - : ; F G  H  ;Hr5rc6eZdZdZdZdZdZdZdZdZ y) TestLogLocatorctjd}tjt5|j dddddt jgd}t|j dd|tjd }t jgd }t|j d d |y#1swYxYw) Nr r\r)h㈵>r r$@@@j@cAeAr g@rrx) rrrq@g @g0@g@@gP@g`@gp@rr ) r+ LogLocatorr@rArWr-rMrNrrbs r3r4zTestLogLocator.test_basicJs  !, ]]: & % OOAt $ %XX@A  COOE59:F  a(XXNO COOAs3Z@ % %s CCctjddi\}}|jd|jddt |j gdy) z< Polar Axes have a different ticking logic. projectionpolar) subplot_kwlogrr )r!r r N)rr set_yscalerr get_yticksr.rrs r3test_polar_axeszTestLogLocator.test_polar_axesXsE,,<*ABR e As2==?OASArsAׇAחAקAeͽArr)r+rrMrNrr-r.llrcs r3test_tick_values_correctz'TestLogLocator.test_tick_values_correctvs>   Y /XXOP BNN1c2J?r5cdtjd<tjd}t j gd}t |jdd|y)NFrr%r)!rr`rrrqrr r r&r r'r(r r)r*r+r,r-rr.r/r0r1r2rr3r4r5r6r7rgeAg _Arr5)rrcParamsr+rrMrNrr-r8s r3test_tick_values_not_emptyz)TestLogLocator.test_tick_values_not_emptysK16 -.   Y /XX78 BNN1c2J?r5ctjjd}|jdggg}t j t |dd\}}t|j|D]+\}}|j|d|jdd -|jD]W}t|j|d jk(sJ|j|d jk(rWJy) Ni!N,r )sizeT)sharexshareyr!)binsrclip) nonpositiver)rMrandom default_rngnormalrrrrflattenhistrrGrget_ylim)r.rng dummy_dataraxesrrs r3test_multiple_shared_axesz(TestLogLocator.test_multiple_shared_axessii##H-jjcj*B3 LLZdK TDLLNJ7 5HB GGDrG " MM%VM 4 5,,. 7Br}}$q'*<*<*>>? ??;;=DG$4$4$66 66 7r5N) rJrKrLr4rrrlr:r=rNr?r5r3rrIs( A=5 (@ @ 7r5rceZdZdZy)TestNullLocatorctj}tjt5|j dddy#1swYyxYw)z Create null locator, and attempt to call set_params() on it. Should not exception, and should raise a warning. N)r+ NullLocatorr@warns UserWarningrkres r3rlzTestNullLocator.test_set_paramss= !!# \\+ &  NN    s AANrJrKrLrlr?r5r3rPrPsr5rPc,eZdZedZedZy) _LogitHelpercd|cxkrdkr[nnXd|cxkrdkrMnnJtjtjd|z dz  tjd|z dz  SdS)NrrF)rMiscloser)rrs r3rYz_LogitHelper.isclosesZq919Q BFF1Q3q5M>BFF1Q3q5M>: 705 7r5ctj|}tj|}tj|dkDrtj|dksJtj|dkDrtj|dksJtjd|z dz  }tjd|z dz  }t ||yr)rMrNrGrr)rrraylxlys r3rz _LogitHelper.assert_almost_equals XXa[ XXa[vvb1f~"&&a.00vvb1f~"&&a.00ffQrT!Vn_ffQrT!Vn_B#r5N)rJrKrL staticmethodrYrr?r5r3rWrWs(77$$r5rWc ,eZdZgdZddej ddzz ddej ddzz ddej ddzz ddej ddzz ddej ddzz ddej dd zz ddej dd zz ddej ddzz gZgd Zejjd e eed Z ejjdedZ ejjdeezdZejjd e eedZdZgdej ddzddej ddzz Zejjdej&edDcgc]\}}||k7r||fc}}}dZejjdedZycc}}}w)TestLogitLocator)rr)rgףp= ?)gMb@?gCl?-C6 ?gSt$?)gh㈵>g;?)gƠ>g?gHj>ge (?)g:0y5>g$P?rr!r[rr rr!rh ))rr)rr`)rrzlims, expected_low_ticksctg|dd|z }tjd}tj |j ||y)zR Create logit locator with huge number of major, and tests ticks. rrr r(N)sortedr+ LogitLocatorrWrr-)r.limsexpected_low_ticksexpected_ticksr2s r3test_basic_majorz!TestLogitLocator.test_basic_majorsX A A# A-?)? A ""-(( COOT "  r5ricTtjd}tjdgd}dD]t}|j||j||j|}|j|}|j |j k(sJ||k(j rtJy)zj When the axis is zoomed, the locator must have the same behavior as MaxNLocator. r r()rrr r!)r)r8)rrhN)r+rhr,rkr-shaperG)r.rir2maxn_locr)ticks maxn_tickss r3test_maxn_majorz TestLogitLocator.test_maxn_majors ""-&&S F /E NNN '   e  ,#COOT*E---t4J;;*"2"22 22Z',,. ..  /r5c.ttjtj|d dzdz}t j d}t |ddD]4}|j|t|j||dzkr4Jy)zB Assert logit locator for respecting nbins param. rrrr r(rN) intrMfloorlog10r+rhrangerkrr-)r.ri basic_neededr2r)s r3test_nbins_majorz!TestLogitLocator.test_nbins_majors BHHRXXd1g%67781* ""-((s$? <B/ JE NNN '  u -)#//40K/)//6K;3~#66K(1,1C 4DDDD007[7;78.J Jr5ctjd}|jrJd|_|jsJ|jd|jrJy)Nr r(TFr)r+rhrrkres r3test_minor_attrz TestLogitLocator.test_minor_attrsM""-99} yyy U#99}9r5rrr)repeatc|tj}|j|}t|t|k(sJy)zd Create logit locator, and test the nonsingular method for acceptable value N)r+rh nonsingularrg)r.rir2lims2s r3test_nonsingular_okz$TestLogitLocator.test_nonsingular_ok$s8""$&d|ve},,,r5okvalctj}d|}}|j||\}}||k(sJd|cxkr|ksJJ|d}}|j||\}}||k(sJ||cxkrdksJJy)zh Create logit locator, and test the nonsingular method for non acceptable value rrrrN)r+rhr)r.rr2r/r0vmin2vmax2s r3test_nonsingular_nokz%TestLogitLocator.test_nonsingular_nok5s ""$%dtT2 u}}5 5     QdtT2 u}}u q     r5N)rJrKrLref_basic_limitsrMrOref_basic_major_ticksref_maxn_limitsr@rRrSrrlrsrzrracceptable_vmin_vmax itertoolsproductrr).0abs000r3r`r`sm  R9299Q? "# R9299Q? "# R9299Q? "# R9299Q? "# R9299Q? "# R9299Q? "# R9299Q? "# R9299Q# #$ GO [[" 34     [[V_5 /6 / [[V%5%GH <I < [[" 34J J2 2q! ! cYRYYr1%% %  [[,)++,@K  AAvF -- [[W&:; !< !! s Hr`ceZdZdZy)TestFixedLocatorctjtddd}|jd|jdk(sJy)z Create fixed locator with 5 nbins, and change it to something else. See if change was successful. Should not exception. rr r(r!N)r+ FixedLocatorrxrkr))r.fixeds r3rlz TestFixedLocator.test_set_paramsGs? $$U1b\; q!{{ar5NrUr?r5r3rrFs r5rceZdZdZy)TestIndexLocatorctjdd}|jdd|jdk(sJ|jdk(sJy)z Create index locator with 3 base, 4 offset. and change it to something else. See if change was successful. Should not exception. r[rrr!N)r+ IndexLocatorrkr"r)r.indexs r3rlz TestIndexLocator.test_set_paramsSsM $$!A6 a*{{a||q   r5NrUr?r5r3rrRs !r5rczeZdZdZej j dddddgfddgdfgdZdZd Z y ) TestSymmetricalLogLocatorctjdd}|jdgd|jdgk(sJ|jdk(sJy)z Create symmetrical log locator with default subs =[1.0] numticks = 15, and change it to something else. See if change was successful. Should not exception. r!rry linthreshrqrh)rr]N)r+SymmetricalLogLocatorrkr#r]r.syms r3rlz)TestSymmetricalLogLocator.test_set_params`sN++qA SEA.yySE!!!||q   r5r&rrrrrrcptjdd}|j||}t||y)Nr!rr)r/r0)r+rr-r)r.r/r0r1rrqs r3 test_valuesz%TestSymmetricalLogLocator.test_valuesls2++qAT55(+r5ctjddddg}|j|jj ddt |gdy)Nr!rrqr)ryrr) irrrrr ()r+rcreate_dummy_axisaxisset_view_intervalrrs r3 test_subsz#TestSymmetricalLogLocator.test_subsysG++qSzR  ""3+35"EFr5ctjdd}|j|jj dd|dgk(j sJ|jj dd|ddgk(j sJ|j ddd k(sJ|j d d d k(sJ|j d d d k(sJy)Nr!rrrhrer r )rr r)rr)MbPr )r+rrrrrGrrs r3test_extendingz(TestSymmetricalLogLocator.test_extendings++qA  ""1a(###%%% ""1b)#t$))+++r2&(222sC(J666q!$777r5N) rJrKrLrlr@rRrSrrrr?r5r3rr_sT ! [[ "A1vQ # ,, G 8r5rc<eZdZdZdZdZdZdZdZdZ dZ y ) TestAsinhLocatorctjdd}|jdk(sJ|jdk(sJ|jdk(sJy)NgX9v@) linear_widthr]r!)r+ AsinhLocatorrr]ryr.lctrs r3 test_initzTestAsinhLocator.test_initsJ##D  E)))}}"""yyBr5c.tjddddd}|jdk(sJ|jdk(sJ|jdk(sJ|j dk(sJ|j d|jdk(sJ|j d|jdk(sJ|j d |jd k(sJ|j d |jd k(sJ|j d |jd k(sJ|j d |jd k(sJ|j d |j d k(sJ|j d|j d k(sJ|j g|j Jy)Nr rr)rg @)rr] symthreshryrr\r)rr!rx)rg@r)r+rr]rryrrkrs r3rlz TestAsinhLocator.test_set_paramss~##-/5)*>}}"""~~&&&yyA~~yyK''' $}}""" }}""" #&~~$$$ $'~~$$$ QyyA~~ T"yyA~~ Z(yyJ&&& T"yyJ&&& R yy   r5cZtjddd}t|jddt j dddt|jd d t j d d d t|jd dt j d ddy)Nr r;rrr]ryrr)\(?r`rrgB`"۹?{Gz?g{GzrgM O?Mb`?r+rrr-rMrOrs r3test_linear_valuesz#TestAsinhLocator.test_linear_valuess##rJD,,R3IIb$4 6D,,T37IIdE48 :D,,UD9IIeVU; =r5ctjddd}t|jddgdt|jdd gd y) Nrr;rrrr ) rrrrrrr`rr r r r ) rrrrrrrr[r r r r+rrr-rs r3test_wide_valuesz!TestAsinhLocator.test_wide_valuessP##rJD,,T374 5 D,,UD97 8r5cptjddd}t|jddgdy) z=8K 9 4" 7r5rceZdZgdZddgZddgZgdZddgddgd d gd d gd dggZgdZe jjdddgdZ e jjdedZ e jjdedZe jjdedZdZdZe jjdedZe jjdedZe jjd ed!Ze jjd ed"Zd#Zd$Zd%Zy&)'TestScalarFormatter)){r)iCir)i50i=0i40)iii)gi@gj@順)gjgi`y)ghi@gj@r)gjghir)iOiQiP)i+i+i+)rrr)rrr)g/' ?g_L?r)g ףp=@g33333@i)g@g`@iȯ)g1е/G?gg޻G?g9̗G?)g\h@gp= @i.1)g"@g(@r)g @@r)g@rr)Gz?rr)g{G#@gQ$@r!)g(\X@gq= ףY@r )g(\@g ףp= @r)g{G/@g(\0@rn)g!rhܿrh|?r)grh|߿rr)g3333@g@@i 0)gffffgffff@rTF) )Fr)r r rF)Trr)rr rF)Tr)rr!rF)Tr)rxrF)Tr)irrF)Tr)rrrF)T)r|r!)gtAg0AreT)Trgjrr F)T)rrrrFrz0.000g( 0?z0.012grh|?z0.123gGz?z1.230g(@z12.300))r1e-1)rz1.1e-1)r51e8)g9Az1.1e8zunicode_minus, result)T−1)F-1c|tjd<tjjj j dj|k(sJy)Naxes.unicode_minusr)rr<rgcarget_major_formatterformat_data_shortstrip)r. unicode_minusrHs r3test_unicode_minusz&TestScalarFormatter.test_unicode_minus2sO.; )* GGIOO / / 1 C CB G M M O   r5zleft, right, offsetcVtj\}}|jj}||k(rt j t dn t5|j||ddd|jj|j|k(sJ||k(rt j t dn t5|j||ddd|jj|j|k(sJy#1swYxYw#1swYAxYw)NzAttempting to set identicalr=) rrrrr@rSrTrr _update_ticksr)r.leftrightrrr formatters r3test_offset_valuez%TestScalarFormatter.test_offset_value:s,,.RHH002 ll;.KL$/M % KKe $ %  6)))ll;.KL$/M % KKt $ %  6))) % %  % %sD DDD( use_offsetctjd|i5tj}||j k(sJ|j dk(sJ dddy#1swYyxYw)Nzaxes.formatter.useoffsetr)rrr+ScalarFormatter get_useOffsetr)r.rtmp_forms r3test_use_offsetz#TestScalarFormatter.test_use_offsetKs` ^^7D E (..0H!7!7!99 99??a' '' ( ( (s ;AA& use_math_textctjd|i5tj}||j k(sJ dddy#1swYyxYw)Naxes.formatter.use_mathtext)rrr+rget_useMathText)r.rrs r3test_useMathTextz$TestScalarFormatter.test_useMathTextRsN ^^:MJ K ?..0H H$<$<$>> >> ? ? ?s *A  Actj}|jd|jrJ|jdk(sJy)Nr)r+r set_useOffsetrrr.rs r3test_set_use_offset_floatz-TestScalarFormatter.test_set_use_offset_floatXsB**,s#))+++#%%%r5ctj}|d}|r|dddgtjgfvrtjdt j ddi5tj}|jsJ|j|jjdd|jgd ||d vsJ dddy#1swYyxYw) N thousands_sepgroupingrzLocale does not apply groupingzaxes.formatter.use_localeTrr!)rrr[r)locale localeconvCHAR_MAXr@skiprrr+r get_useLocalerrset_data_intervalset_locs)r.convseprs r3test_use_localez#TestScalarFormatter.test_use_locale^s  "?#d:&rs+V__4E/FF KK8 9 ^^8$? @ (..0H))+ ++  & & ( MM + +Ar 2   i ((3-' '' ( ( (s #A2CC(z.sci_type, scilimits, lim, orderOfMag, fewticksctj}|j||j|t j \}}|j j||j||r.|j jtjd|j|j j||jk(sJy)Nr)r+rset_scientificset_powerlimitsrrrset_major_formatterrrr,rget_majorticklocsorderOfMagnitude) r.sci_type scilimitsr orderOfMagfewticksrrrs r3test_scilimitsz"TestScalarFormatter.test_scilimitsms**,)  +,,.R $$X. S  HH & &w':':1'= >"((4467X66666r5zvalue, expectedc~dtjd<tj}|j ||k(sJy)NFr)rr<r+r format_data)r.valuer1sfs r3test_format_dataz$TestScalarFormatter.test_format_data|s6-2 )*  $ $ &~~e$000r5zdata, expectedctj\}}|jdd|jj j }|||k(sJy)Nrr)rrrrrr)r.rr1rrfmts r3test_cursor_precisionz)TestScalarFormatter.test_cursor_precisionsI,,.R Bhh**,>>4yH$$$r5c2tj}|j|jj dd|j }|||k(sJ|jj dk(sJ|jjdk(sJy)Nrr!re)r+rrrrrget_tick_space get_minpos)r.rr1r,r/s r3test_cursor_dummy_axisz*TestScalarFormatter.test_cursor_dummy_axiss $ $ &  !!!R(""4yH$$$ww%%'1,,,ww!!#q(((r5ctjjddddttj j dkrit jtd5tj\}}|jgd|jjdddyt jtd 5t jtd5tj\}}|jgd|jjddddddy#1swYyxYw#1swYxYw#1swYyxYw) Nserifcmr10F) font.familyz font.serifr rhzcmr10 font should ideallyr=rz Glyph 8722)rr<update parse_versionr@ __version__rrSrTrrrcanvasdrawrs r3test_mathtext_ticksz'TestScalarFormatter.test_mathtext_tickss "!+0  ++ , 2 2Q 6k1LM ",,.R j) ! " " ,,{,? ",,{2MN ",,.R j) !  " " "  " "  " " " "s2%AEE*AE /EE  E EE!ctjjdddd|jtj d5t j\}}|jddgd dg|jd gd }tj}|j|t|||jj|j rJ dddy#1swYyxYw) Nr7cmT)r8zmathtext.fontsetr zmatplotlib.mathtext)loggergQrrr)rrrr)rr<r9at_levelloggingWARNINGrrplotrr+LogFormatterSciNotation set_yticksmapr<r=text)r.caplogrryticksrs r3test_cmr10_substitutionsz,TestScalarFormatter.test_cmr10_substitutionss " $+/  __W__5J_ K #llnGC GGUDMB: . MM% 'F779I MM&#i"8 9 JJOO {{ "?{ # # #s BC**C3chtj}|jg|ddk(sJy)Nr)r+rr)r.r,s r3test_empty_locsz#TestScalarFormatter.test_empty_locss+  $ $ & B#w"}}r5N)rJrKrL offset_datause_offset_datauseMathText_datascilimits_data cursor_datar*r@rRrSrrrr rrr(r-r0r4r>rLrOr?r5r3rrsKBUmOe} N W    x KK [[47GII  [[2K@*A*  [[\?;(<(  [[_.>??@? & ( [[8.J 7J 7 [[. <1=1  [[-{;%<%  [[-{;)<)"&#$r5rc eZdZddejddejddgdfddej dd ej d d d ged gdfddej gdeed gdfgZ dddej ejgZ e jjde e jjde dZdZy)TestLogFormatterExponentTrrr)z-3z-2r0123Fr!rr r`rgh㈵r)0.1z1e-053.14z0.2z-0.2z-1e-05r)r[r r*dtype)rZ51242rqrr z2labelOnlyBase, exponent, locs, positions, expectedrycFtj||}|j|jj d||z||z}t ||D cgc]\} } || | } } } |D cgc]} | j dd}} | |k(sJycc} } wcc} w)Nry labelOnlyBaser-u−)r+LogFormatterExponentrrrrreplace) r.reryexponentlocs positionsr1rvalsrposlabelslabels r3r4z#TestLogFormatterExponent.test_basics 00d?LN ##%((D(N;Tz47i4HIC)As#IIFNOUEMM#'78OO!!!JOs B5Bctjdd}|j|jj dd|ddk(sJy)Nr!Trdrg&$?rN)r+rgrrr)r.rs r3 test_blankz#TestLogFormatterExponent.test_blanksG00bM ##%((B/!R'''r5N)rJrKrLrMrOrNpirxfloat param_datae base_datar@rRrSr4rqr?r5r3rVrVs q)"))B$ibiiC&8 / 1 HBHHc7BEE3hGH qD F HBHH^5958  ! Jc4-I [[ @*N [[VY/ "0N "(r5rVczeZdZejZgdZejjdedZ y)TestLogFormatterMathtext))rr$\mathdefault{10^{0}}$)rrz$\mathdefault{10^{-2}}$)rr z$\mathdefault{10^{2}}$)r[rz$\mathdefault{1}$)r[rz$\mathdefault{0.01}$)r[r z$\mathdefault{100}$)r[r z$\mathdefault{10^{-3}}$)r[r z$\mathdefault{10^{3}}$zmin_exponent, value, expectedctjd|i5|j||k(sJ dddy#1swYyxYw)Nzaxes.formatter.min_exponent)rrr/)r. min_exponentr+r1s r3test_min_exponentz*TestLogFormatterMathtext.test_min_exponents? ^^:LI J /88E?h. .. / / /s 9AN) rJrKrLr+LogFormatterMathtextr/ test_datar@rRrSr|r?r5r3rxrxs@ &' & & (C I [[z$\mathdefault{2\times10^{-5}}$)r!rz$\mathdefault{2\times10^{0}}$)r!i@ z$\mathdefault{2\times10^{5}}$)r!rcz$\mathdefault{5\times10^{-5}}$)r!r z$\mathdefault{5\times10^{0}}$)r!i z$\mathdefault{5\times10^{5}}$defaultzbase, value, expectedctj|}tjddi5|||k(sJ dddy#1swYyxYw)Nrx text.usetexF)r+rFrr)r.ryr+r1rs r3r4z&TestLogFormatterSciNotation.test_basic sM33> ^^]E2 3 0U#x/ // 0 0 0s AAN) rJrKrLr~rstylerr@rRrSr4r?r5r3rrsGI& YYy! [[4i@0A"0r5rczeZdZgdZej j dedZej j dgddZddZ e jjdd Z ej j d gd d Zej j d gd dZy)TestLogFormatter))}9x?r z3.142e-5)Gŷ4?r z3.142e-4)ei?r z3.142e-3)\, ?r z3.142e-2)s7v/?r z3.142e-1)PERT! @r 3.142)f)zj?@r z3.142e1)&FYs@r z3.142e2)WXp/@r z3.142e3)mnL@r z3.142e4),Ar z3.142e5)r r 1e-5)rr 1e-4)r r 1e-3)rr 1e-2)rr r)rr rX)r!r 10)r r 100)r r 1000)'r 1e4)rr 1e5)rrrW)rrrW)rr0.003)rr0.031)rr0.314)rrr)rr31.416)rr314.159)rr3141.593)rr 31415.927)rr 314159.265)r rrW)rrrW)r r0.001)rr0.01)rrr[)rrrX)r!rr)r rr)r rr)rr10000)rr100000)rrrW)rrrW)rrr)rrr)rrr)rrr)rrr)rrr)rrr)rrr)rrr)r rrW)rrrW)r rr)rrr)rrr[)rrrX)r!rr)r rr)r rr)rrr)rrr)rr rW)rr rW)rr rW)rr z0.03)rr z0.31)rr r\)rr z31.42)rr z314.16)rr z3141.59)rr z31415.93)rr z 314159.27)r r rW)rr rW)r r rW)rr r)rr r[)rr rX)r!r r)r r r)r r r)rr r)rr r)rr rW)rr rW)rr rW)rr rW)rr z0.3)rr 3.1)rr z31.4)rr z314.2)rr z3141.6)rr z31415.9)rr z314159.3)r r rW)rr rW)r r rW)rr rW)rr r[)rr rX)r!r r)r r r)r r r)rr r)rr r)rr0z3.1e-5)rr0z3.1e-4)rr0z3.1e-3)rr0z3.1e-2)rr0z3.1e-1)rr0r)rr0z3.1e1)rr0z3.1e2)rr0z3.1e3)rr0z3.1e4)rr0z3.1e5)r r0r)rr0r)r r0r)rr0r)rr0r)rr0rX)r!r0r)r r0r)r r0r)rr0r)rr0rzvalue, domain, expectedc^tj}|j||}||k(sJyN)r+ LogFormatter _pprint_val)r.r+domainr1r/ros r3 test_pprintzTestLogFormatter.test_pprints.""$v.   r5zvalue, long, short))rrWrW)rrWrW)rz-10^0r)g|=z2x10^-10z2e-10)g _Bz10^10z1e+10ctj\}}|jd|jj }|j ||k(sJ|j ||k(sJy)Nr)rr set_xscalerrr*r)r.r+longshortrrr/s r3r-z!TestLogFormatter.test_format_datasa,,.R ehh**,u%---$$U+u444r5cH|j}|j}|j||dtjtj |zz }|Dcgc]}t ||v}}|Dcgc] }||dk7} }| |k(sJycc}wcc}w)z.Test whether locator marks subs to be labeled.r!rNN)get_minor_formatterrrrMrvrwround) r.rrr/ minor_tlocscoefsclabel_expectedr label_tests r3 _sub_labelszTestLogFormatter._sub_labelss&&(,,.  [!b288BHH[,A#BCC49:q%(d*::,78qc!fl8 8^+++;8s $B>Brc $tj\}}|jd|jj t j dg|jjt j dtjdd|jjt jd|jjt jd|jdd |jj}|j|jj!|jj!Dcgc] }||d k7}}tj"|sJ|j%|jg |jdd |j%|jg |jdd |j%|jg |jdd|j%|jgd |jdd|j%|jtjddt& ycc}w)Nrr!)ryrrT)reFrr+rNri Prh)rr[rrrrr^)rrrrrr+rrrMrOr!rset_minor_formatterrrrr"rGrru)r.rrr/rshow_major_labelss r3 test_sublabelzTestLogFormatter.test_sublabels,,.R e ""7#5#52B#GH ""7#5#52;=99Q;K$M N $$W%9%9%MN $$W%9%9%NO Ashh**, RXX//12&(hh&@&@&BD!"!Vr\DDvv'((( + As + Ar + Aq  5 C  !Rs(CD-Ds,J val)rr!r r ctj}|j|jj dd||t |k(sJyNrr!)r+rrrrstrr.rtemp_lfs r3test_LogFormatter_callz'TestLogFormatter.test_LogFormatter_callsH&&(!!# &&q"-s|s3x'''r5)ggggctj}|j|jj dd||yr)r+rrrrrs r3test_LogFormatter_call_tinyz,TestLogFormatter.test_LogFormatter_call_tinys9&&(!!# &&q"- r5N)r?)rJrKrL pprint_datar@rRrSrr-rrrrrrrr?r5r3rrsEKN [[6 D!E!  [[1455, YYy!#E"#EJ [[U$67(8( [[U$FGHr5rc eZdZedZej jdgddZe e ddDcgc]}d| z c}}e ddDcgc] }dd| zz  c}}zdgzZ ej jde d Z ej jdd d Z ej jdddejej d d d zz dZgdZej jdedZdZdZdZej jdddZycc}}wcc}}w)TestLogitFormattercRtjd|}|rL|ddu}|drt|dnd}|dt|dnd}|d|zz}|ds|d |rd|z S|Stjd |}|r!t|d t|d }}||z St d ) z Parser to convert string as r'$\mathdefault{1.41\cdot10^{-4}}$' in float 1.41e-4, as '0.5' or as r'$\mathdefault{\frac{1}{2}}$' in float 0.5, zT[^\d]*(?P1-)?(?P\d*\.?\d*)?(?:\\cdot)?(?:10\^\{(?P-?\d*)})?[^\d]*$compNmantrexporr!z4[^\d]*\\frac\{(?P\d+)\}\{(?P\d+)\}[^\d]*$numdenozNot formatted by LogitFormatter)rUr>rsrurW)stringr>rmantissarr+rrs r3logit_deformatterz$TestLogitFormatter.logit_deformatters    =,D/4V}uU6]+!H).v)B3uV}%DrTz)EV}f 9u9$  CV  eEl+U5=-AC: :;;r5zfx, x))zSTUFF0.41OTHERSTUFFg= ףp=?)zSTUFF1.41\cdot10^{-2}OTHERSTUFFg!u?)zSTUFF1-0.41OTHERSTUFFgzG?)z!STUFF1-1.41\cdot10^{-2}OTHERSTUFFgx $(~?)STUFFN)zSTUFF12.4e-3OTHERSTUFFNc|8tjt5tj |dddytj |}t j ||sJy#1swYyxYwr)r@rArWrrrWrY)r.fxrrs r3test_logit_deformaterz(TestLogitFormatter.test_logit_deformaterse 9z* 9"44R8 9 9#44R8A''1- --  9 9s A))A2rr!rrctjd}|j|j||}tj |}t j||sJy)zj Test the formatted value correspond to the value for ideal ticks in logit space. F use_overlineN)r+LogitFormatterr decade_testrrrWrY)r.rrsx2s r3r4zTestLogitFormatter.test_basic*sW **> 4++, aL  1 1! 4##Ar***r5)rrrrrrctjd}|j|j||}|dk(sJy)zl Test that invalid value are formatted with empty string without raising exception. FrrNN)r+rrr)r.rrrs r3 test_invalidzTestLogitFormatter.test_invalid6s< **> 4++, aLBwwr5r|r!c>tjd}dD]}|d|z zdks|j|d|z z ||d|z zg||}||d|z z}tj |tj |z }d|cxkr d|z krJJy)zS The format length should change depending on the neighbor labels. Fr) r!r rr r iirrrrN)r+rrrr)r.rrNsxsx1ds r3test_variablelengthz&TestLogitFormatter.test_variablelengthAs **> @ %A1q5y1}""AAIq!a!e)#<=q\AE *&88=(::2>?1}q1u}$}$} %r5))Trd)rF)KF)Trb)rrT)Tra)rTr)F)rgRQ?gp= ף?))r!Trrzmethod, lims, casesc|r&tjd}|j|}ntj|}tj d}|D]v\}}|j ||j|} | D cgc]} t| dkDs| } } |rt| dkDrWJ||ft| dk(roJ||fycc} w)z, Test minor/major displays. TrrN) r+rhr-rMrNrset_minor_threshold format_ticksr) r.methodricasesmin_locrqmin_form threshold has_minor formattedflabelleds r3test_minor_vs_majorz&TestLogitFormatter.test_minor_vs_majorYs **6G'G''.EHHTNE))5$) B Iy  ( ( 3 --e4I#,;aA ;H;8}q(@9i*@@(8})AIy+AA) BBcd}d}d}tjd}|||k(sJ|jd|||k(sJ|jd|||k(sJy)z1 Test the parameter use_overline rz$\mathdefault{1-10^{-2}}$z"$\mathdefault{\overline{10^{-2}}}$FrTN)r+rr)r.rfx1fx2forms r3test_use_overlinez$TestLogitFormatter.test_use_overline{so *3%%59Aw#~~ $Aw#~~ % Aw#~~r5ctj}d|dvsJ|jdd|dvsJ|jdd|dvsJy)z- Test the parameter one_half z \frac{1}{2}rz1/2zone halfN)r+r set_one_half)r.rs r3 test_one_halfz TestLogitFormatter.test_one_halfsd%%'c*** % S !!! *%T#Y&&&r5r)r ictjdd|dd}tj}|D]W}|j |}|j drdt |ddz }n t |}t||z d|z krWJy)Nrrrz1-r)rMrrr+rr startswithrsabs)r.rrjrrrrs r3test_format_data_shortz)TestLogitFormatter.test_format_data_shorts{{1a#Ab)%%' 'A''*B}}T"r!"v&2Yq2v;Q& &&  'r5N)rJrKrLr^rr@rRrSrrgrxrr4rrMexprrrlims_minor_majorrrrrr )ris00r3rrs<<@ [[  . ."1b\**#(B< 0a1rqbz> 0 1 ' K  [[S+. +/ + [[S"?@A [[S!q6266;2;;r1b3I2I+J'J"KL%M%  [[24DEBFB( 1  ' [[S/2 '3 'a + 0s E E rceZdZdZy)TestFormatStrFormattercHtjd}d|dk(sJy)Nz%05d00002r)r+FormatStrFormatterrs r3r4z!TestFormatStrFormatter.test_basics$--f5(1+%%%r5N)rJrKrLr4r?r5r3rrs&r5rcXeZdZgdZej j dedZy)TestStrMethodFormatter)){x:05d}rFr)rrTr)rrFz-0002)rrTu−0002){x:03d}-{pos:02d}rrF002-01)rrTr)rrrFz-02-01)rrTu−02-01z&format, input, unicode_minus, expectedctjd|i5tj|}|||k(sJ dddy#1swYyxYw)Nr)rrr+StrMethodFormatter)r.formatinputrr1r/s r3r4z!TestStrMethodFormatter.test_basicsK ^^1=A B +,,V4C;(* ** + + +s AA N)rJrKrLr~r@rRrSr4r?r5r3rrs0 I [[EyQ+R+r5rcXeZdZgdZej j dedZy)TestEngFormatter))FEJ)z -1.23457 k-1 kz-1.23 k)Tr%)u −1.23457 k−1 ku −1.23 k)FރB)z-1.23457rz-1.23)Tr()u −1.23457ru−1.23)F_c97ݚ)z -123.457 mz-123 mz -123.46 m)Tr))u −123.457 mu−123 mu −123.46 m)FQ^-':T)z -1.23457 mz-1 mz-1.23 m)Tr*)u −1.23457 mu−1 mu −1.23 m)TgrWrWz0.00Trr+r,)Tgm>)u 1.23457 µu1 µu1.23 µ)Tg_c97ݚ?)z 123.457 mz123 mz123.46 m)Tr)100 mr-z100.00 m)Tr)rXrXz1.00)TgރB?)z1.23457rXz1.23)Tg33333?@)z999.91 kz999.90)Tg*:?@r.r.1.00 k)F*:?)r&r&z-1.00 k)Tr1)r'r'u −1.00 k)Tr r/)Ti)z1.001 kr.r0)Ti)z 100.001 kz100 kz100.00 k)TgZ $.A)z 987.654 kz988 kz987.65 k)TgCY,dRF)1230 Qr2z 1230.00 Qzunicode_minus, input, expectedc |tjd<d d|}tjtjdtjdf}t ||D]\}}|||k(rJ fd|D}tj tj d tj d f}t ||D]\}}|||k(rJd D]  fd |D}tj tj d tj d f}t ||D]\}}|||k(rJ fd|D}tj tjd tjd f}t ||D]\}}|||k(rJy)a Test the formatting of EngFormatter for various values of the 'places' argument, in several cases: 0. without a unit symbol but with a (default) space separator; 1. with both a unit symbol and a (default) space separator; 2. with both a unit symbol and some non default separators; 3. without a unit symbol but with some non default separators. Note that cases 2. and 3. are looped over several separator strings. rr 0123456789r)placesrc3FK|]}|dvr|dzzn|zywr Nr?)r_sDIGITSUNITs r3 z/TestEngFormatter.test_params..s8:*,+-R&F*:rCx$I&:s!)unit)r=r5)rNu z@_@c3fK|](}|dvr|zzn|jdz*ywr7rh)rr9r:r;_seps r3r<z/TestEngFormatter.test_params..sE/!02"v/?29t+ " 3 5 <=/s.1)r=r)r=r5rc3BK|]}|jdyw)r8Nr?)rr9r@s r3r<z/TestEngFormatter.test_params.."sDR2::c40Ds)r)r5rN)rr<r+ EngFormatterr) r.rr"r1 exp_outputs formatters _formatter _exp_outputr:r;r@s @@@r3 test_paramszTestEngFormatter.test_paramss.; )*  "   *   * (+:{'C 4 #J e$ 3 33 4 :08:   d +  d1 5  d1 5 (+:{'C 4 #J e$ 3 33 4 = 8D/%-/K$$$D9$$$qdC$$$qdCJ ,/z;+G 8' K!%(K777 8 E8DK$$.$$A48$$A48J ,/z;+G 8' K!%(K777 81 8r5N)rJrKrLraw_format_datar@rRrSrGr?r5r3r$r$s3#OJ [[=OD8PD8r5r$ctj\}}|jgdgd|jgdt j dt j dfD]k}|j j||jj|jDcgc]}|j}}|gdk(rkJycc}w)N)rrr T)usetex) useMathText)z$0$z$500$z$1$ k) rrrErr+rBrr!r<r=get_xticklabelsget_text)rrrlablx_tick_label_texts r3$test_engformatter_usetex_useMathTextrP,sllnGCGGNN+MM.!**$7**t<>>  $$Y/ 9;9K9K9MNT]]_NN!$====>Os7Cz9data_offset, noise, oom_center_desired, oom_noise_desired))g@ROBr!rer)gBBirr)/$&;@rrr)g5@rr[r)gAr r[r)p= p@r rr)guHBr rer[)rQgHz>ri)rRrrr)rQrrr)g@@rrr[)rQrrr[)rQr rr[)rQr rr)rQr!rrcd}tj\}}|tjddt|zz}|j |t jd|}d|jd<|jj||jj|j} |jD cgc]} | j} } |j rP| d } |j|} | d t#|z }|j|}| | k(sJ||k(sJ| D]}||vrJy|dk(sJ| d k(sJ| D]1}|dd k(rdn|}|j%|j||zr1Jycc} w) NeVrr!r^T) useOffsetr=_rrrrNrW)rrrMrOrsrEr+rB ENG_PREFIXESrr!r<r= get_offsetget_yticklabelsrMrrendswith) data_offsetnoiseoom_center_desiredoom_noise_desiredr;rrydatar offset_gotrN ticks_gotprefix_noise_gotprefix_noise_desiredprefix_center_gotprefix_center_desiredtick prefix_idxs r3test_engformatter_offset_oomrh:s< DllnGC "))B7= =EGGEN$$t$?I #I1HH  +JJOO%%'J-/-?-?-ABTBIB %a=(556GH&r#d)|4 ) 6 67I J#'7777$(9999 $Dt# ## $"Q&&&R LD#1gn2CJ==!7!7 !Cd!JK KK  L)Cs FceZdZgdZgdZgdZejjdeedZ ejjdedZ y ) TestPercentFormatter))r r%rr z120%)r rrkr Zz100%)r rrkrlrz90%)r rrkrrz-2%)r rrkgV@r z90.0%)r rrkgfffffT@rlz80.1%)r rrkgQQ@rz70.2%)r rrkgxFNrz-60.6%)r Nrk_rz95.00%)rNrkr[rz300%)1@Nrkrg!@z6%)rnNrkrg @z5.9%)r Nrkrgư>z -2000.00000%)rrNrr z120.00)rr[rNrr z66.667)r]Nz ^^Foobar$$rz50.0^^Foobar$$)zdecimals=0, x>100%zdecimals=0, x=100%zdecimals=0, x<100%zdecimals=0, x<0%zdecimals=1, x>100%zdecimals=1, x=100%zdecimals=1, x<100%zdecimals=1, x<0%z$autodecimal, x<100%, display_range=1z7autodecimal, x>100%, display_range=6 (custom xmax test)z;autodecimal, x<100%, display_range=8.5 (autodecimal test 1)z;autodecimal, x<100%, display_range=8.4 (autodecimal test 2)z=autodecimal, x<-100%, display_range=1e-6 (tiny display range)zNone as percent symbolzEmpty percent symbolzCustom percent symbol))FF50\{t}%)FTz 50\\\{t\}\%)TFrp)TTrpz2xmax, decimals, symbol, x, display_range, expected)idsctj|||}tjddi5|j |||k(sJ dddy#1swYyxYw)NrFrcr+PercentFormatterrr format_pct)r.xmaxdecimalssymbolr display_ranger1rs r3r4zTestPercentFormatter.test_basics] ,,T8VD ^^ u5 6 F''=9XE EE F F F AAzis_latex, usetex, expectedctjd|}tjd|i5|j dd|k(sJ dddy#1swYyxYw)Nz\{t}%)rzis_latexrrsrr ru)r.r~rJr1r/s r3 test_latexzTestPercentFormatter.test_latexsS&&hJ ^^ v6 7 7>>"c*h6 66 7 7 7r|N) rJrKrL percent_data percent_ids latex_datar@rRrSr4rr?r5r3rjrj}spL.K,J [[ @ k+F+F  [[9:F7G7r5rjc tjtjdt j dd}d}|j|d}|dk(sJd}|j|d}|d k(sJt j d d}d }|j|d}|d k(sJy#tj$rt dYywxYw) Nz de_DE.UTF-8z9SKIP: Locale de_DE.UTF-8 is not supported on this machineT)rK useLocalez$\mathdefault{%1.1f}$rz$\mathdefault{0{,}5}$z,$\mathdefault{,%1.1f},$z,$\mathdefault{,0{,}5},$Fz%1.1fz0,5)r setlocaleLC_ALLErrorprintr+r_format_maybe_minus_and_locale)rqr/rs r3_impl_locale_commars 6  # # EE "C ,,S#6A ( (( ( %C ,,S#6A + ++ +  # # FE C ,,S#6A :: << IJs$B&&CCctjjtdddi}t d|j j Dd}|rtj|yy)Nr% MPLBACKENDAgg)timeout extra_envc3vK|]1}|jdr|tddj3yw)zSKIP:N)r rr)rlines r3r<z$test_locale_comma..s820#g,-(..02s79rN) rrsubprocess_run_helperrnextstdout splitlinesr@r)procskip_msgs r3test_locale_commarsj ;; , ,-?8De7L - ND2!%!7!7!92H Hr5ctj\}}tjt5|j j tjdddy#1swYyxYwr) rrr@rArTrr!r+rrrs r3test_majformatter_typerMllnGC y !; $$W%7%7%9:;;; .A((A1ctj\}}tjt5|j j tjdddy#1swYyxYwr) rrr@rArTrrr+rrs r3test_minformatter_typerrrctj\}}tjt5|j j tjdddy#1swYyxYwr) rrr@rArTrrr+rrs r3test_majlocator_typerMllnGC y !; ""7#7#7#9:;;;rctj\}}tjt5|j j tjdddy#1swYyxYwr) rrr@rArTrrr+rrs r3test_minlocator_typerrrctjfd}|ddd|ddd|ddd|dddy)Nc8||d}tj|5jdd|}dddtjj dkD|k(sJt|j j dkD|k(sJy#1swY`xYw)N)zxtick.minor.visiblezytick.minor.visiblersrr)rr add_subplotrrget_minor_ticksr)xminoryminorrrtrrs r3minorticksubplotz,test_minorticks_rc..minorticksubplots%+%+- ^^r " *Aq)B *BHH,,./!3>>>BHH,,./!3>>>  * *s BBFrTrr[r)rfigure)rrs @r3test_minorticks_rcrsE **,C?UE1%T5!$UD!$T4#r5ctjfd}gd}|D]>}|dd|d|dd|d|dd|d|dd|dj@tjy ) ax Test toggling minor ticks Test `.Axis.minorticks_on()` and `.Axis.minorticks_off()`. Testing is limited to a subset of built-in scales - `'linear'`, `'log'`, `'asinh'` and `'logit'`. `symlog` scale does not seem to have a working minor locator and is omitted. In future, this test should cover all scales in `matplotlib.scale.get_scale_names()`. cLjdd|}|j||j||s|s|j|r6|s4|jj |j j|s6|r4|jj|j j |r|r|j t|jjdkD|k(sJt|j jdkD|k(sJy)Nrr) rrrminorticks_offrrrrr)rrscalerrrs r3minortickstogglez0test_minorticks_toggle..minortickstoggles __Q1 % e ef     & HH " " $ HH # # %& HH # # % HH " " $ f    BHH,,./!3>>>BHH,,./!3>>>r5)linearrasinhlogitFrTrr[rN)rrclearclose)rscalesrrs @r3test_minorticks_togglersy **,C?$1Fua0ueQ/eQ/tUA. IIcNr5z%remove_overlapping_locs, expected_num))Tr)Nr)Frec0tjddd}tjt|}t j \}}|j |||jjtjj|jjtjjd|jjtjjd|jj!tjjd|jj#d|||j_|jj$}||jj'k(sJt j(|j| |jj$}||jj$k(sJt|jj+|k(sJt|jj#|k(sJt|jj-|k(sJt|jj/|d zk(sJy) Nz 2018-11-03z 2018-11-06 datetime64r^z %a)rrrz%H:%Mr")remove_overlapping_locsr)rMrOonesrrrrErrrdates DayLocatorr! DateFormatterr HourLocatorrrrget_remove_overlapping_locssetprget_minorticklabelsget_minorticklines)r expected_numtrrrcurrentnews r3test_remove_overlapr9s , LAA AAllnGCGGAqMHHsyy3356HH  !8!8!@AHHsyy44^DEHH  !8!8!ABHHR *+B(hh..G rxx;;= => =HHRXXw7 (( * *C 28833 34 3 rxx))+ , << < rxx'') *l :: : rxx++- ., >> > rxx**, -a ?? ?r5subhiaardvark)rrctj}tjt5|j |dddy#1swYyxYw)Nr)r+rr@rArWrk)rr9s r3test_bad_locator_subsr^sA    B z "  3    s A  Ar])rrr[rerc tj}|j|dD]_}|jd|}t j t j |jdddk(jr_Jy)Nr\)r r!rer;r"rr r rrr)r+rrkr-rMdiffrwrG)r]r9toprqs r3test_small_range_loglocatorrgsu    BMM8M$/Fr3'3!789Q>CCEEEFr5ctj}|ddk(sJ|jddk(sJ|jddk(sJy)NrrN)r+ NullFormatterr*rrs r3test_NullFormatterrqsT%%'I S>R     % ++ +  & &s +r 11 1r5rc d|S)Nzval: r?)rs r3rys eA3Kr5)r:barcz|jdk(sJ|jd|jdk(sJy)NrNr)rXset_offset_stringrs r3test_set_offset_stringrxs@    !R '' ' &    !U ** *r5cDtj\}}|jtjddg|jtjddg|jtjddg|j d|j d|j |j|jsJt|jjtjjsJy) z Turning on minor gridlines in a multi-Axes Figure that contains more than one boxplot and shares the x-axis should not raise an exception. r!r)rkrr)whichrN)rrboxplotrMrOrrdraw_without_renderingget_xgridlines isinstancerget_minor_locatorrtickerrrs r3test_minorticks_on_multi_figrs llnGCJJryy}J,JJryy}J,JJryy}J,GG'GGG'G     bhh002CJJ4O4O PP Pr5)D contextlibrrrrCrUpackaging.versionrr:numpyrM numpy.testingrrr@ matplotlibrmatplotlib.pyplotpyplotrmatplotlib.tickerrr+rrYrurrrPrWr`rrrrrrVrxrrrrrr$rPrRrSrhrjrrrrrrrrrzerosrrrrr FuncFormatterFixedFormatterrrr?r5r3rs"  4A #,,,,^FF<8!8!vmHmH`L7L7^$$"O!O!d    ! !)8)8Xb7b7JLL^!(!(H//&008ZZzo'o'd&&++&n8n8b >?B0(L10(LVB7B7J*  ; ; ; ; $$%P@&'@ '@B : BHHV!  \29F3F2G/0G>*',-+-+ Qr5