+
     ]i$ c                   s~   ^ RI Ht ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RI	t
^ RIHtHt ^ RIt^ RIt^ RIHt ^ RIHt  ! R R4      t ! R R4      t ! R	 R
4      t ! R R4      t ! R R4      t ! R R4      t ! R R4      t ! R R4      t ! R R4      t ! R R4      t  ! R R4      t! ! R R4      t" ! R R4      t# ! R R 4      t$ ! R! R"4      t% ! R# R$4      t& ! R% R&4      t' ! R' R(4      t( ! R) R*4      t) ! R+ R,4      t* ! R- R.4      t+R/ t,]PZ                  P]                  R0. RJO4      R1 4       t/ ! R2 R34      t0R4 t1R5 t2R6 t3R7 t4R8 t5R9 t6R: t7R; t8]PZ                  P]                  R<RK4      R= 4       t9]PZ                  P]                  R>R?R@.]
Pt                  ! RL4      .4      RA 4       t;]PZ                  P]                  RB. RMO4      ]Px                  P{                  RC4      RD 4       4       t>RE t?]PZ                  P]                  RF]P                  ! RG 4      ]P                  ! RN4      34      RH 4       tBRI tCR# )O    )nullcontextN)parse)assert_almost_equalassert_array_equalc            
       sF  a  ] tR t^t o ^^d]P
                  ! . RO4      3RR]P
                  ! . RO4      3RR]P
                  ! . RO4      3^ R]P                  ! ^4      R,          3R^ ]P                  ! R^4      R,          3.tRRR]P
                  ! . RO4      3RRR]P
                  ! . RO4      3^^7. RO]P
                  ! . R O4      3.t]	P                  P                  R	]4      R
 4       t]	P                  P                  R]4      R 4       t]	P                  P                  RR^ /]]P                   ! R4      3R^^./]R3R^/]R3R^^./]R3.4      R 4       t]	P                  P                  R. R!O. R!O3^^
.. R!O3^^.. R!O3^.. R!O3.4      R 4       tRtV tR# )"TestMaxNLocatorMbP?-C6?  4&kCg&q5gLog5皙?Nffffff?vmin, vmax, expectedc                sj    \         P                  ! ^R7      p\        VP                  W4      V4       R# )   nbinsNmtickerMaxNLocatorr   tick_values)selfvminvmaxexpectedloc   &&&& C/usr/lib64/python3.14/site-packages/matplotlib/tests/test_ticker.py
test_basicZTestMaxNLocator.test_basic    s%    !!*COOD7B    zvmin, vmax, steps, expectedc                sn    \         P                  ! ^RVR7      p\        VP                  W4      V4       R# )r   T)r   ZintegerstepsNr   )r   r   r   r   r   r      &&&&& r   test_integerZTestMaxNLocator.test_integer%   s)    !!4uECOOD7Br   zkwargs, errortype, matchfooz5set_params() got an unexpected keyword argument 'foo'r   z$steps argument must be an increasingc                s    \         P                  ! W#R 7      ;_uu_ 4        \        P                  ! R/ VB  RRR4       R#   + '       g   i     R# ; i)matchN )pytestraisesr   r   )r   kwargsZ	errortyper!      &&&&r   test_errorsZTestMaxNLocator.test_errors*   s3     ]]922)&) 3222s   AA	zsteps, resultc                s~    \         P                  ! VR 7      pVP                  V8H  P                  4       '       g   Q hR# ))r   N)r   r   _stepsall)r   r   resultr      &&& r   test_paddingZTestMaxNLocator.test_padding5   s2     !!.

f$))++++r   r"   )      4@g      D@g      N@g      T@      Y@)        g-C6*?g-C6:?ga2U0*C?g-C6J?r     4&k)r0   g  4&kr/   g  4&kBr   g&q皙)r          )g      пr          ?      ?      ?      ?)r4         ?r      
   )r          i-   <   )r4   r5   r<   )__name__
__module____qualname____firstlineno__nparrayarangeZ
basic_dataZinteger_datar#   markparametrizer   r   	TypeErrorreZescape
ValueErrorr'   r,   __static_attributes____classdictcell____classdict__   @r   r   r      s    	S"((567	!LMN	bhhJKL	
HbiilU*+	AryyQ'%/0J 
sD"((=12	tT288$DEF	
B"BHH-@$ABL [[3Z@C AC [[:LIC JC [[7
Y	J	K	M
Aq6	J(NO
1z#IJ
Ar7	Z)OP: ** [[_	Z 
R*
Q
j	/ ,,r   r   c                   s8   a  ] tR t^@t o R tR tR tR tRtV t	R# )TestLinearLocatorc                s    \         P                  ! ^R7      p\        P                  ! . RO4      p\	        VP                  RR4      V4       R# )   numticks皙?N皙)rV   333333ӿrU   )r   LinearLocatorrD   rE   r   r   r   r   
test_value   &  r   r   ZTestLinearLocator.test_basicA   s6    ##Q/XX/0
COOD#6
Cr   c                s^    \         P                  ! ^ R7      pVP                  RR4      . 8H   R# )r    rS   rU   NrV   )r   rX   r   r   r      & r   test_zero_numticksZ$TestLinearLocator.test_zero_numticksF   s%    ##Q/c"b(r   c                s    \         P                  ! ^R7      pVP                  ^R. /R7       VP                  ^8X  g   Q hVP                  R. /8X  g   Q hR# )z
Create linear locator with presets={}, numticks=2 and change it to
something else. See if change was successful. Should not exception.
rS   )rT   presetsNr    r4   )r   rX   
set_paramsrT   r_   r\   r]   r   test_set_paramsZ!TestLinearLocator.test_set_paramsJ   sP    
 ##Q/FB<8||q   {{vrl***r   c                s   \         P                  ! R. ROR	RR./R7      pVP                  ^^4      . RO8X  g   Q hVP                  ^^4      . RO8X  g   Q hVP                  ^ ^4      RR.8X  g   Q hVP                  RR4      RR.8X  g   Q hVP                  ^ ^4      \        P                  ! ^ ^^4      8H  P                  4       '       g   Q hR# )
r4   r7   r:   )r_   r/          @N)r4   r5   )r4         ?      ?r    r5   )r   rX   r   rD   linspacer)   r\   r]   r   test_presetsZTestLinearLocator.test_presetsT   s    ##V_-3c3Z-A Bq!$777q!$777q!$c
222sC(S#J6661%Q2)>>CCEEEEr   r"   N)
r@   rA   rB   rC   r   r^   rb   rh   rL   rM   rN   rP   r   rQ   rQ   @   s!     D
)+F Fr   rQ   c                   sJ   a  ] tR t^^t o R tR tR tR tR tR t	R t
RtV tR	# )
TestMultipleLocatorc                s    \         P                  ! R R7      p\        P                  ! . RO4      p\	        VP                  R^
4      V4       R# )V-	@baseN)go"V-gV-	r/   rj   V-@go"@gV-)@r   MultipleLocatorrD   rE   r   r   rY   r[   r   r   ZTestMultipleLocator.test_basic_   s:    %%51XX . /
COOB3Z@r   c                s    \         P                  ! R RR7      p\        P                  ! . RO4      p\	        VP                  R^
4      V4       R# )rj   333333?rl   offsetN)gZd{ gK7A`gx&rr   gSc@g`"@gx&1H%@ro   rp   rY   r[   r   test_basic_with_offsetZ*TestMultipleLocator.test_basic_with_offsete   s<    %%5=XX ' (
COOB3Z@r   c                s    \         P                  ! RR/4      ;_uu_ 4        \        P                  ! RR7      p\	        VP                  R^4      R4       RRR4       R#   + '       g   i     R# ; i)z%
Test basic behavior of view limits.
axes.autolimit_modedatarj   rk   Nr1   )r1   r   mpl
rc_contextr   rq   r   view_limitsr\   r]   r   test_view_limitsZ$TestMultipleLocator.test_view_limitsk   sM     ^^2F;<<))u5CA 6@ =<<<   4AA0	c                s    \         P                  ! RR/4      ;_uu_ 4        \        P                  ! RR7      p\	        VP                  R^4      R4       RRR4       R#   + '       g   i     R# ; i)J
Test that everything works properly with 'round_numbers' for auto
limit.
rv   round_numbersrj   rk   N)rm   rn   rx   r\   r]   r   test_view_limits_round_numbersZ2TestMultipleLocator.test_view_limits_round_numberss   sN    
 ^^2ODEE))u5CA 6H FEEEr}   c                s    \         P                  ! RR/4      ;_uu_ 4        \        P                  ! RRR7      p\	        VP                  R^4      R4       RRR4       R#   + '       g   i     R# ; i)	r~   rv   r   rj   ?rs   Nr   )g`"g}?5^@rx   r\   r]   r   *test_view_limits_round_numbers_with_offsetZ>TestMultipleLocator.test_view_limits_round_numbers_with_offset|   sP    
 ^^2ODEE))uSACA 6H FEEEs   5A  A1	c                s    \         P                  ! RR/4      ;_uu_ 4        \        P                  ! ^R7      p\	        VP                  RR4      R4       RRR4       R#   + '       g   i     R# ; i)z=
Test that 'round_numbers' works properly with a single bin.
rv   r   r   gffffff@Ngffffff)r      )ry   rz   r   r   r   r{   r\   r]   r   test_view_limits_single_binZ/TestMultipleLocator.test_view_limits_single_bin   sN     ^^2ODEE%%A.Cc :GD FEEEr}   c                s    \         P                  ! RR7      pVP                  RR7       VP                  P                  R8X  g   Q hVP                  ^R7       VP
                  ^8X  g   Q hR# )zg
Create multiple locator with 0.7 base, and change it to something else.
See if change was successful.
ffffff?rk   333333?)rt   N)r   rq   ra   Z_edgeZstepZ_offset)r   Zmultr]   r   rb   Z#TestMultipleLocator.test_set_params   sX    
 &&C0S!zz#%%%q!||q   r   r"   N)r@   rA   rB   rC   r   ru   r|   r   r   r   rb   rL   rM   rN   rP   r   ri   ri   ^   s3     AAAIIE	! 	!r   ri   c            
       s  a  ] tR t^t o R tRR.tR t]P                  P                  R]4      R 4       t
. ROtR t]P                  P                  R]4      R 4       t. ROt. RO. RO. RO. RO. RO. RO. RO. RO.t]! ]! ]]4      4      t]P                  P                  R]4      R	 4       t]P                  P                  R
RR.4      ]P                  P                  RR. RO3R. RO3.4      R 4       4       t]P                  P                  R
RR.4      ]P                  P                  R^R . R!O3^R". R#O3^
R$. R%O3.4      R 4       4       tRtV tR# )&TestAutoMinorLocatorc                s    \         P                  ! 4       w  rVP                  ^ R4       VP                  4        \        P
                  ! . RO4      p\        VP                  P                  RR7      V4       R# )r    =
ףp=?TminorN皙?皙?g333333?r6   333333?gffffff??r7   皙?g?r   r8   g333333??r
   ?r	   gffffff?rd   r   g?)	pltsubplotsset_xlimminorticks_onrD   rE   r   xaxisget_ticklocsr   figaxrZ      &   r   r   ZTestAutoMinorLocator.test_basic   s\    ,,.
At
XX G H
 	BHH111=zJr   c                sL   \         P                  ! 4       w  rVP                  RR4       VP                  P	                  \
        P                  ! 4       4       \        P                  ! . RNRNRNRNRNRNRNRNRNRNRNRNR NR!NR"NR#NRNRNRNRNRNRNR
NR	NRNRNRNRNRNRNRNRN4      p\        VP                  P                  RR7      V4       VP                  R$^4       \        P                  ! . R%O4      p\        VP                  P                  RR7      V4       R# )&z9
Test that first and last minor tick appear as expected.
gffffff?g?r   g?gffffff?r   rr   r	   r   皙?r   333333?皙?r   rU   r   Tr   Ngffffffg333333ggffffffgg333333皙grV   gffffffg333333皙ٿrW   皙ɿr2   r1   )g      g      g      g      g      g                  r7   r9   r:         @g      @      @g      @      @)r   r   r   r   set_minor_locatorr   AutoMinorLocatorrD   rE   r   r   r   r   r   test_first_and_last_minorticksZ3TestAutoMinorLocator.test_first_and_last_minorticks   s   
 ,,.
D#
""7#;#;#=>XX Bt BT B4 B Bt BT B4 B B#B%)B+/B15B7;B=ABCGBIMB"B$'B),B.1B36B8;B=@BBEBGJB  #B %(B *-B /2B 47B 9<B >AB C
 	BHH111=zJ
BXX G H
BHH111=zJr   z%nb_majorticks, expected_nb_minorticksc                s   \         P                  ! 4       w  r4RpVP                  ! V!   VP                  \        P
                  ! V^ ,          V^,          V4      4       VP                  4        VP                  P                  \        P                  ! 4       4       \        VP                  P                  4       4      V8X  g   Q hR# )r    N)r    r   )r   r   r   
set_xticksrD   rg   r   r   r   r   r   lenget_minorticklocs)r   Znb_majorticksZexpected_nb_minorticksr   r   xlims   &&&   r   test_low_number_of_majorticksZ2TestAutoMinorLocator.test_low_number_of_majorticks   s     ,,.
U
bkk%(E!HmDE

""7#;#;#=>288--/04JJJJr   c                sF   \         P                  ! R R/4      ;_uu_ 4        V P                   Uu. uF  q^ ,          NK  	  pp\        P                  P                  V\        P                  ! 4       P                  4       RRR4       R# u upi   + '       g   i     R# ; i)_internal.classic_modeFN)	ry   rz   majorstep_minordivisionsrD   testingZassert_allcloser   ZAutoLocatorr(   )r   xZ
majorstepsr[   r   "test_using_all_default_major_stepsZ7TestAutoMinorLocator.test_using_all_default_major_steps   su    ^^5u=>>(,(E(EF(E1A$$(EJFJJ&&z'.':':'<'C'CE ?>F ?>>s   BB
?B
BB 	z&major_step, expected_nb_minordivisionsc                s^   \         P                  ! 4       w  r4^ V3pVP                  ! V!   VP                  V4       VP	                  4        VP
                  P                  \        P                  ! 4       4       \        VP
                  P                  4       4      ^,           pWb8X  g   Q hR# r    N)r   r   r   r   r   r   r   r   r   r   r   )r   Z
major_stepZexpected_nb_minordivisionsr   r   r   Znb_minor_divisionss   &&&    r   test_number_of_minor_ticksZ/TestAutoMinorLocator.test_number_of_minor_ticks   s     ,,.J
U
e

""7#;#;#=> !;!;!=>B!???r   zlim, refc                s   \         P                  ! 4       w  r4VP                  4        VP                  R RR^R7       VP                  R RR^R7       VP	                  V4       \        VP                  P                  R R7      V4       R# )	Tr   y)	linewidthmajorZk)Zcolorr   r   N)r   r   r   gridset_ylimr   yaxisr   )r   limrefr   r      &&&  r   test_additionalZ$TestAutoMinorLocator.test_additional  sk    ,,.

gsa0
gSA6
CBHH111=sCr   use_rcparamFTc           	     sl   V'       d
   R RRR/p/ pM/ pRR/p\         P                  ! V4      ;_uu_ 4        \        P                  ! 4       w  rgVP                  ! V!   VP
                  ! V!   VP                  P                  \        P                  ! R/ VB 4       VP                  P                  \        P                  ! R/ VB 4       \        VP                  P                  RR7      V4       \        VP                  P                  RR7      V4       RRR4       R#   + '       g   i     R# ; i)xtick.minor.ndivsZautoytick.minor.ndivsnTr   Nr"   )ry   rz   r   r   r   r   r   r   r   r   r   r   r   )r   r   r   r   contextr%   r   r   s   &&&&    r   test_number_of_minor_ticks_autoZ4TestAutoMinorLocator.test_number_of_minor_ticks_auto  s     *F4GPGFG6]F^^G$$llnGCKKKKHH&&w'?'?'I&'IJHH&&w'?'?'I&'IJ 5 5D 5 A3G 5 5D 5 A3G %$$$s   C"D""D3	zn, lim, refc           	     s(   V'       d
   R VRV/p/ pM/ pRV/p\         P                  ! V4      ;_uu_ 4        \        P                  ! 4       w  rxVP                  ! V!   VP
                  ! V!   VP                  P                  \        P                  ! ^4      4       VP                  P                  \        P                  ! R/ VB 4       VP                  P                  \        P                  ! ^4      4       VP                  P                  \        P                  ! R/ VB 4       \        VP                  P                  RR7      V4       \        VP                  P                  RR7      V4       RRR4       R#   + '       g   i     R# ; i)r   r   r   Tr   Nr"   )ry   rz   r   r   r   r   r   set_major_locatorr   rq   r   r   r   r   r   )	r   r   r   r   r   r   r%   r   r   s	   &&&&&    r   test_number_of_minor_ticks_intZ3TestAutoMinorLocator.test_number_of_minor_ticks_int.  s    *A/BAFGFG1XF^^G$$llnGCKKKK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 %$$$s   E F  F	r"   Nr    r    )r4   r    ))r4   r   )r5   r   )r   r   )r   r   )r<   r   r    r   r    gn?)r   r   )r    ԍ;)r    gVs?=)gH׊gIhG|a)gv!>ҷ>)ʔA{v()g"s2_dglEՎfUr   ){Gzt?{Gz?Q?g?gQ?gQ?g
ףp=
?r   g)\(?gp=
ף?gQ?g333333?g(\µ?g
ףp=
?gRQ?gzG?)\(?gq=
ףp?      ?gp=
ף?gHzG?)gO
;gO
;gU;g#B;gU;g̈=;gnP*@;g#B;gԍ;gaW;g̈=;gmx;gJ;gnP*@;gnXen;g+3M;r   )g+<g+=gt=gvIh%=gt =g(#=gQu.U)=gvIh%,=gU.=gnb]K2=g(3=g7Q5=gU>?7=gQu.U9=gc߯x:=g; ==gU>=)g*#&,gYg#"5Ԉg_eG|gS'цgBY[%gk̈́gv!g|)vgQ؎gqrgƀg%e~gw$}g߈/|gYygv(xgS'vgv!tgz]rgqrqgw$mgHjgv(hgz]b)gL>gE/w>gZMϢ>gkʹ>g	ʧ#>g!+lěN>g:0y>gR>g};h>gBY[%>gqwNP>gʔA{>gS'Ѷ>g>g.W'>gG)R>gxz)e秷>r   )g5m/Gg<gT跾g`gxz)e秷gIGmg肸zggG)Rg<g&|gg5_涾gqdqAg34gY#)g#"5Ըg_~r   gҷg.W'gS'Ѷr   gBY[%g:0yg	ʧ#gkʹgE/wgE̳g|)vg<sAC gz]ʲgQ؎g 4PSȱgqrg>g\+-eqg+i)+gM7܉g%eޮgw$)r    r   )r7   r:   r   r   rf   )r6   r7   r8   rd   r:   re   r`   )	r   rU   r   r   r7   r   r   r   r   )r@   rA   rB   rC   r   Zparamsr   r#   rG   rH   r   r   r   r   ZlimitsZ	referencelistzipZadditional_datar   r   r   rL   rM   rN   rP   r   r   r      s    K 	F
K& [[DfM	K N	K )E [[E57	@7	@>F	B		'	'	
	1	E	/I: 3vy12O[[Z9D :D [[]UDM:[[GH "#	
	H	 ;H" [[]UDM:[[,-:;FG
H ;Hr   r   c                   sJ   a  ] tR tRt o R tR tR tR tR tR t	R t
R	tV tR
# )TestLogLocatoriI  c                s   \         P                  ! ^R7      p\        P                  ! \        4      ;_uu_ 4        VP                  ^ R4       RRR4       \        P                  ! . RO4      p\        VP                  RR4      V4       \         P                  ! ^R7      p\        P                  ! . RO4      p\        VP                  ^^d4      V4       R#   + '       g   i     L; i)	r   rS     Nr   g     @rk   )h㈵>r   r         $@     @@     j@    cA    eA)
r7   r9   rc         @g       @g      0@g      @@g      P@g      `@g      p@)	r   
LogLocatorr#   r$   rK   r   rD   rE   r   rY   r[   r   r   ZTestLogLocator.test_basicJ  s      !,]]:&&OOAt$ ' XX @ A
 	COOE59:F  a(XXNO
COOAs3Z@ '&s   CC&	c                s    \         P                  ! RR/R7      w  rVP                  R4       VP                  ^^d4       \	        VP                  4       . RO4       R# )z,
Polar Axes have a different ticking logic.
Z
projectionZpolar)Z
subplot_kwlogN)r<   d   r   )r   r   
set_yscaler   r   
get_yticksr   r   r   r[   r   test_polar_axesZTestLogLocator.test_polar_axesX  sC     ,,<*AB
e
As2==?O<r   c                s,   \         P                  ! R R7      p\        VP                  RR4      . R	O4       \         P                  ! \        P
                  ! ^^
4      R7      pRVP                  RR4      9  g   Q hRVP                  RR4      9  g   Q hR# )
r)   subsr   r   r9   r   r-   r   N)g)\(?gq=
ףp?gQ?r7   gp=
ף?gHzG?gQ?)r   r   r   r   rD   rF   r\   r]   r   test_switch_to_autolocatorZ)TestLogLocator.test_switch_to_autolocatora  sz      e,3??46D	F   bii2&67#//#s33333??34444r   c                s    \         P                  ! 4       pVP                  ^R.^R7       VP                  ^8X  g   Q hVP                  ^8X  g   Q h\        VP                  4      R.8X  g   Q hR# )z
Create log locator with default value, base=10.0, subs=[1.0],
numticks=15 and change it to something else.
See if change was successful. Should not raise exception.
rc   )rT   r   rl   N)r   r   ra   rT   _baser   _subsr\   r]   r   rb   ZTestLogLocator.test_set_paramsj  s`       "A6||q   yyA~~CII3%'''r   c                s    \         P                  ! RR7      p\        P                  ! . RO4      p\	        VP                  ^R4      V4       R# )r4   r   r   Nr4   r5   r   )r   rU   r7   r9   rc   r   r   r-         I@r.         i@     @@r        @@     @     @     @     j@r        jA    A    .A    >A    SAr       sA    ׇA    חA    קA    eͽA)r   r   rD   rE   r   r   r   llrZ   r[   r   test_tick_values_correctZ'TestLogLocator.test_tick_values_correctv  s>    Y/XX O P

 	BNN1c2J?r   c                sB   R \         P                  R&   \        P                  ! R%R7      p\        P
                  ! . RNRNRNRNRNRNR	NR
NRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNR NR!NR"NR#N4      p\        VP                  ^R4      V4       R$# )&Fr   r   r   rU   r7   r9   rc   r   r   r-   r   r.   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r   g    eAg    _ANr   )ry   rcParamsr   r   rD   rE   r   r   r  r[   r   test_tick_values_not_emptyZ)TestLogLocator.test_tick_values_not_empty  ss   16-.Y/XX 7v 7v 7v 7v 7v 7v 7%7'-7/577=7?E7GM7%7'-7/577=7?E7GM7  &7 (.7 067 8>7 @F7 HN7  &	7 (.	7 06	7 8>	7 @F	7 HN	7
  &7
 (.7
 067 8
 	BNN1c2J?r   c                s@   \         P                  P                  R 4      pVP                  ^dR7      . . .p\        P
                  ! \        V4      RRR7      w  r4\        VP                  4       V4       F+  w  rVVP                  V^
R7       VP                  RRR7       K-  	  VP                  4        Fh  p\        VP                  4       V^ ,          P                  4       8H  4      '       g   Q hVP                  4       V^ ,          P                  4       8X  d   Kh  Q h	  R# )	i!N,)ZsizeT)ZsharexZsharey)Zbinsr   Zclip)ZnonpositiveN)rD   ZrandomZdefault_rngZnormalr   r   r   r   ZflattenZhistr   r)   r   Zget_ylim)r   ZrngZ
dummy_datar   Zaxesr   rw   s   &      r   test_multiple_shared_axesZ(TestLogLocator.test_multiple_shared_axes  s    ii##H-jjcj*B3
LLZdK	DLLNJ7HBGGDrG"MM%VM4 8 ,,.Br}}$q'*<*<*>>????;;=DG$4$4$6666 !r   r"   N)r@   rA   rB   rC   r   r   r   rb   r  r  r  rL   rM   rN   rP   r   r   r   I  s0     A=5
(@	@7 7r   r   c                   &   a  ] tR tRt o R tRtV tR# )TestNullLocatori  c                s    \         P                  ! 4       p\        P                  ! \        4      ;_uu_ 4        VP                  4        RRR4       R#   + '       g   i     R# ; i)zp
Create null locator, and attempt to call set_params() on it.
Should not exception, and should raise a warning.
N)r   ZNullLocatorr#   warnsUserWarningra   r\   r]   r   rb   ZTestNullLocator.test_set_params  s:    
 !!#\\+&&NN '&&&s   AA$	r"   Nr@   rA   rB   rC   rb   rL   rM   rN   rP   r   r	  r	    s      r   r	  c                   s@   a  ] tR tRt o ]R 4       t]R 4       tRtV tR# )_LogitHelperi  c                s   ^ T u;8  d   ^8  ds   M Mo^ Tu;8  d   ^8  da   M M]\         P                  ! \         P                  ! ^V ,          ^,
          4      ) \         P                  ! ^V,          ^,
          4      ) 4      # R# )r    F)rD   iscloser   )r   r   s   &&r   r  Z_LogitHelper.isclose  sZ     q919Q 

BFF1Q3q5M>BFF1Q3q5M>: 	705	7r   c                s   \         P                  ! V 4      p\         P                  ! V4      p\         P                  ! V^ 8  4      '       d    \         P                  ! V^8  4      '       g   Q h\         P                  ! V^ 8  4      '       d    \         P                  ! V^8  4      '       g   Q h\         P                  ! ^V,          ^,
          4      ) p\         P                  ! ^V,          ^,
          4      ) p\	        WE4       R# r   )rD   rE   r)   r   r   )r   r   r   ZayZlxZly   &&    r   r   Z _LogitHelper.assert_almost_equal  s    XXa[XXa[vvb1f~~"&&a..00vvb1f~~"&&a..00ffQrT!Vn_ffQrT!Vn_B#r   r"   N)	r@   rA   rB   rC   staticmethodr  r   rL   rM   rN   rP   r   r  r    s+     7 7 $ $r   r  c                   s  a ] tR tRt o. ROt^^
]P                  ! ^^4      ,          ,          ^^
]P                  ! ^^4      ,          ,          ^^
]P                  ! ^^4      ,          ,          ^^
]P                  ! ^^4      ,          ,          ^^
]P                  ! ^^4      ,          ,          ^^
]P                  ! ^^4      ,          ,          ^^
]P                  ! ^^	4      ,          ,          ^^
]P                  ! ^^
4      ,          ,          .t. ROt]	P                  P                  R]! ]]4      4      R 4       t]	P                  P                  R]4      R 4       t]	P                  P                  R]],           4      R 4       t]	P                  P                  R]! ]]4      4      R 4       tR t. R	]P                  ! R^ 4      ,          O^R	]P                  ! R^ 4      ,          ,
          Ot]	P                  P                  R]P(                  ! ]^R
7       U Uu. uF  w  rW8w  g   K  W3NK  	  upp 4      R 4       t]	P                  P                  R]4      R 4       tRtVtR# u upp i )TestLogitLocatori  zlims, expected_low_ticksc                s    \        . VORN^V,
          O4      p\        P                  ! ^dR7      p\        P	                  VP
                  ! V!  V4       R# )zB
Create logit locator with huge number of major, and tests ticks.
r7   r   N)sortedr   LogitLocatorr  r   r   )r   limsexpected_low_ticksexpected_ticksr   r   r   test_basic_majorZ!TestLogitLocator.test_basic_major  sV      A A#A-?)?A
 ""-((OOT"	
r   r  c                sp   \         P                  ! ^dR7      p\         P                  ! ^d. ROR7      pR F~  pVP                  VR7       VP                  VR7       VP                  ! V!  pVP                  ! V!  pVP
                  VP
                  8X  g   Q hWV8H  P                  4       '       d   K~  Q h	  R# )zR
When the axis is zoomed, the locator must have the same behavior as
MaxNLocator.
r   )r   r   N)r4   r5   r   r<   )r         )r   r  r   ra   r   Zshaper)   )r   r  r   Zmaxn_locr   ticksZ
maxn_ticks   &&     r   test_maxn_majorZ TestLogitLocator.test_maxn_major  s     ""-&&SFENNN'e,OOT*E!--t4J;;*"2"2222',,....  r   c                s`   \        \        P                  ! \        P                  ! V^ ,          4      4      ) 4      ^,          ^,           p\        P
                  ! ^dR7      p\        V^R4       F<  pVP                  VR7       \        VP                  ! V!  4      V^,           8:  d   K<  Q h	  R# )z2
Assert logit locator for respecting nbins param.
r   Nr3   )
intrD   floorlog10r   r  rangera   r   r   )r   r  basic_neededr   r      &&   r   test_nbins_majorZ!TestLogitLocator.test_nbins_major  s     BHHRXXd1g%67781<q@""-<B/ENNN's-.%!);;; 0r   c                s(   \        . VORN^V,
          O4      p\        V4      p\        P                  ! ^dR7      p\        P                  ! ^dRR7      p\	        V^R4       F  pVP                  VR7       VP                  VR7       VP                  ! V!  pVP                  ! V!  p	\        V4      \        V4      8  d,   \        V4      ^,
          ^,          \        V	4      8  g   Q hK  \        P                  \        . VOV	O4      V4       K  	  R# )z\
In large scale, test the presence of minor,
and assert no minor when major are subsampled.
r7   r   T)r   r   Nr3   )	r  r   r   r  r   ra   r   r  r   )
r   r  r  r  r!  r   Z	minor_locr   Zmajor_ticksZminor_ticks
   &&&       r   
test_minorZTestLogitLocator.test_minor  s      A A#A-?)?A
 >*""-((s$?	<B/ENNN'  u -//40K#//6K;3~#66K(1,1C4DDDD 007[7;78.J 0r   c                s    \         P                  ! ^dR7      pVP                  '       d   Q hRVn        VP                  '       g   Q hVP                  RR7       VP                  '       d   Q hR# )r   r   TFr   N)r   r  r   ra   r\   r]   r   test_minor_attrZ TestLogitLocator.test_minor_attr  sS    ""-999}	yyyyU#999}9r   r   )Zrepeatc                s    \         P                  ! 4       pVP                  ! V!  p\        V4      \        V4      8X  g   Q hR# )zL
Create logit locator, and test the nonsingular method for acceptable
value
N)r   r  nonsingularr  )r   r  r   Zlims2   &&  r   test_nonsingular_okZ$TestLogitLocator.test_nonsingular_ok$  s6     ""$&d|ve},,,r   okvalc                s    \         P                  ! 4       pRTrCVP                  W44      w  rVWd8X  g   Q h^ Tu;8  d	   V8  g   Q h Q hT^rCVP                  W44      w  rVWS8X  g   Q hYVu;8  d	   ^8  g   Q h Q hR# )zP
Create logit locator, and test the nonsingular method for non
acceptable value
Nr3   )r   r  r'  )r   r*  r   r   r   Zvmin2Zvmax2r  r   test_nonsingular_nokZ%TestLogitLocator.test_nonsingular_nok5  s     ""$%dt2}}5 5     Qdt2}} q     r   r"   N)r   r
   )r   gףp=
?)gMb@?gCl?-C6
?gSt$?)gh㈵>g;?)gƠ>g?gHj>ge(?)g:0y5>g$P?))r   r   )r   rU   )r   r
   )r@   rA   rB   rC   Zref_basic_limitsrD   rF   Zref_basic_major_ticksZref_maxn_limitsr#   rG   rH   r   r  r  r#  r%  r&  Zacceptable_vmin_vmax	itertoolsZproductr)  r+  rL   rM   )aZbrO   s   00@r   r  r    sV    	 	
R299Q?"#	R299Q?"#	R299Q?"#	R299Q?"#	R299Q?"#	R299Q?"#	R299Q?"#	R299Q##$	 GO[["34
	
 [[V_5/ 6/ [[V%5%GH	< I	< [["34J	J2
2q!
!
cRYYr1%%
%
 [[ $++,@K	
Kv QFK	
-- [[W&:;! <!!	
s   
I*-I*r  c                   r  )TestFixedLocatoriF  c                s    \         P                  ! \        ^ ^4      ^R7      pVP                  ^R7       VP                  ^8X  g   Q hR# )zy
Create fixed locator with 5 nbins, and change it to something else.
See if change was successful.
Should not exception.
r   N)r   ZFixedLocatorr   ra   r   )r   Zfixedr]   r   rb   Z TestFixedLocator.test_set_paramsG  s?     $$U1b\;q!{{ar   r"   Nr  rN   rP   r   r3  r3  F  s        r   r3  c                   r  )TestIndexLocatoriR  c                s    \         P                  ! ^^R7      pVP                  ^^R7       VP                  ^8X  g   Q hVP                  ^8X  g   Q hR# )z
Create index locator with 3 base, 4 offset. and change it to something
else. See if change was successful.
Should not exception.
rs   N)r   ZIndexLocatorra   r   rt   )r   Zindexr]   r   rb   Z TestIndexLocator.test_set_paramsS  sM     $$!A6a*{{a||q   r   r"   Nr  rN   rP   r   r4  r4  R  s     	! 	!r   r4  c                   s   a  ] tR tRt o R t]P                  P                  R^ ^^ ^.3R	^. R
O3.4      R 4       tR t	R t
RtV tR# )TestSymmetricalLogLocatori_  c                s    \         P                  ! ^
^R7      pVP                  R.^R7       VP                  R.8X  g   Q hVP                  ^8X  g   Q hR# )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.
rl   	linthreshrc   )r   rT   N)r   SymmetricalLogLocatorra   r   rT   r   symr]   r   rb   Z)TestSymmetricalLogLocator.test_set_params`  sN     ++qASEA.yySE!!!||q   r   r   c                sp    \         P                  ! ^
^R7      pVP                  WR7      p\        WS4       R# )r<   r6  )r   r   N)r   r8  r   r   )r   r   r   r   r:  r     &&&&  r   test_valuesZ%TestSymmetricalLogLocator.test_valuesl  s.     ++qAT55+r   c                s    \         P                  ! ^
^RR.R7      pVP                  4        VP                  P	                  R^
4       \        V! 4       . RO4       R# )r<   rc   r   )rl   r7  r   N)	ir   r    r5   r      (   )r   r8  create_dummy_axisaxisset_view_intervalr   r9  r]   r   	test_subsZ#TestSymmetricalLogLocator.test_subsy  sG    ++qSzR""3+35"EFr   c                s   \         P                  ! ^
^R7      pVP                  4        VP                  P	                  ^^	4       V! 4       R.8H  P                  4       '       g   Q hVP                  P	                  ^^4       V! 4       RR.8H  P                  4       '       g   Q hVP                  ^
^
4      R8X  g   Q hVP                  RR4      R8X  g   Q hVP                  ^ ^ 4      R8X  g   Q hR# )	r<   r6  r9   r   N)r4   r   r=  )r3   )MbPr   )r   r8  rB  rC  rD  r)   r{   r9  r]   r   test_extendingZ(TestSymmetricalLogLocator.test_extending  s    ++qA""1a(###%%%%""1b)#t$))++++r2&(222sC(J666q!$777r   r"   Nr3   r3   r    r4   )r@   rA   rB   rC   rb   r#   rG   rH   r<  rE  rH  rL   rM   rN   rP   r   r5  r5  _  s\     
! [["A1vQ
#,,G	8 	8r   r5  c                   sP   a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
tV tR# )TestAsinhLocatori  c                s    \         P                  ! R ^R7      pVP                  R 8X  g   Q hVP                  ^8X  g   Q hVP                  ^
8X  g   Q hR# )gX9v@)linear_widthrT   N)r   AsinhLocatorrK  rT   rl   r   Zlctrr]   r   	test_initZTestAsinhLocator.test_init  sJ    ##D  E)))}}"""yyBr   c                sf   \         P                  ! ^^R^R	R7      pVP                  ^8X  g   Q hVP                  R8X  g   Q hVP                  ^8X  g   Q hVP
                  R	8X  g   Q hVP                  ^R7       VP                  ^8X  g   Q hVP                  R4       VP                  ^8X  g   Q hVP                  RR7       VP                  R8X  g   Q hVP                  RR7       VP                  R8X  g   Q hVP                  ^R7       VP                  ^8X  g   Q hVP                  RR7       VP                  ^8X  g   Q hVP                  R
R7       VP
                  R
8X  g   Q hVP                  RR7       VP
                  R
8X  g   Q hVP                  . R7       VP
                  e   Q hR# )r   r   )rK  rT   	symthreshrl   r   rS   Nr7   )rO  rk   r   )r   g      
@)r5   g     @)r   rL  rT   rO  rl   r   ra   rM  r]   r   rb   Z TestAsinhLocator.test_set_params  s~   ##-/5)*> }}"""~~&&&yyA~~yyK'''$}}"""}}"""#&~~$$$$'~~$$$QyyA~~T"yyA~~Z(yyJ&&&T"yyJ&&&R yy   r   c                sd   \         P                  ! ^d^^ R7      p\        VP                  R^4      \        P
                  ! RRR4      4       \        VP                  RR4      \        P
                  ! RRR4      4       \        VP                  RR4      \        P
                  ! RRR	4      4       R
# )r   rK  rT   rl   )\(?rU   r   gB`"۹?{Gz?r   gMO?Mb`?Nr3   r2   g{Gzr   rL  r   r   rD   rF   rM  r]   r   test_linear_valuesZ#TestAsinhLocator.test_linear_values  s    ##rJD,,R3IIb$4	6D,,T37IIdE48	:D,,UD9IIeVU;	=r   c                s    \         P                  ! R ^^ R7      p\        VP                  R^d4      . RO4       \        VP                  RR4      . RO4       R# )r   rP  r   NrF  )rF  r>  r1   r3   r   r    rU   r4   r   r@  r   )rV  rF  r>  r0  r   r    r   rR   r@  r   r   r   rL  r   r   rM  r]   r   test_wide_valuesZ!TestAsinhLocator.test_wide_values  sP    ##rJD,,T374	5 	D,,UD97	8r   c                st    \         P                  ! ^d^^ R7      p\        VP                  RR4      . RO4       R# )z<Check that manually injected zero will supersede nearby tickrP  r   Nr   )r   r/   r   rW  rM  r]   r   test_near_zeroZTestAsinhLocator.test_near_zero  s.    ##qqID,,T379IJr   c                s    \         P                  ! R ^R7      p\        VP                  ^e^f4      \        P
                  ! ^eRR4      4       R# )r9   rS   gq=
ףY@r   NrT  rM  r]   r   test_fallbackZTestAsinhLocator.test_fallback  s;    ##C"5D,,S#6IIc637	9r   c                s   \         P                  ! ^^R^ R7      pVP                  4        VP                  P	                  R^4       \        V! 4       . RO4       VP                  P	                  RR4       \        V! 4       . R	O4       VP                  P	                  R
R4       \        V! 4       . R	O4       VP                  P	                  ^R4       \        V! 4       . RO4       R# )r4   r6   )rK  rT   rO  rl   r   r   r	   Nr3   )r3   r    r5   rI  g333333)r4   r   r	   )r   rL  rB  rC  rD  r   rM  r]   r   test_symmetrizingZ"TestAsinhLocator.test_symmetrizing  s    ##Q.2< 		##B*DFJ/		##B,DFJ/		##E40DFJ/		##As+DFN3r   c                s    \         P                  ! ^^^
RR7      p\        VP                  R^n4      . RO4       \         P                  ! ^^^R7      p\        VP                  RR4      . R	O4       R# )
r4   )rK  rT   rl   r   rP  i  N)r4   rR   r   )iirF  iir=  r1   r0  r3   r   rW   r2   r    r   r   r7   r4   rR   r   r<   r>   2   r   i,    i)iiir1   r3   r   r    rU   r4   r      i}   iq  rW  )r   Zlctr10Zlctr5r[   r   test_base_roundingZ#TestAsinhLocator.test_base_rounding  sk    %%1q+-I?F..tS9A	B
 $$!bqIE--eT:6	7r   r"   N)r@   rA   rB   rC   rN  rb   rU  rX  rY  rZ  r[  r`  rL   rM   rN   rP   r   rJ  rJ    s3     !>=8K94"7 7r   rJ  c                   s  a  ] tR tRt o . R$OtRR.tRR.t. R%OtRR.RR.RR	.R
R.RR..t. R&Ot	]
P                  P                  RR'R(.4      R 4       t]
P                  P                  R]4      R 4       t]
P                  P                  R]4      R 4       t]
P                  P                  R]4      R 4       tR tR t]
P                  P                  R]4      R 4       t]
P                  P                  R]	4      R 4       t]
P                  P                  R]4      R 4       t]
P                  P                  R]4      R 4       tR tR  tR! tR"tV tR## ))TestScalarFormatteri  TFr/   z0.000g(0?z0.012grh|?z0.123gGz?z1.230g(@z12.300zunicode_minus, resultc                s    V\         P                  R &   \        P                  ! 4       P                  P                  4       P                  R4      P                  4       V8X  g   Q hR# )axes.unicode_minusNr3   )ry   r  r   Zgcar   get_major_formatterformat_data_shortstrip)r   unicode_minusr*   s   &&&r   test_unicode_minusZ&TestScalarFormatter.test_unicode_minus2  sO     .;)*GGIOO//1CCBGMMO	r   zleft, right, offsetc                s   \         P                  ! 4       w  rEVP                  P                  4       pW8X  d   \        P
                  ! \        R R7      M	\        4       ;_uu_ 4        VP                  W4       RRR4       VP                  P                  4        VP                  V8X  g   Q hW8X  d   \        P
                  ! \        R R7      M	\        4       ;_uu_ 4        VP                  W!4       RRR4       VP                  P                  4        VP                  V8X  g   Q hR#   + '       g   i     L; i  + '       g   i     LR; i)zAttempting to set identicalr    N)r   r   r   rc  r#   r
  r  r   r   Z_update_ticksrt   )r   ZleftZrightrt   r   r   	formatter   &&&&   r   test_offset_valueZ%TestScalarFormatter.test_offset_value:  s    ,,.HH002	  ll;.KL$/M2 2KK$2 	 6)))  ll;.KL$/M2 2KK$2 	 6)))2 22 2s   &D*!D=*D:	=E	
use_offsetc                s    \         P                  ! R V/4      ;_uu_ 4        \        P                  ! 4       pWP	                  4       8X  g   Q hVP
                  ^ 8X  g   Q h RRR4       R#   + '       g   i     R# ; i)zaxes.formatter.useoffsetN)ry   rz   r   ScalarFormatterget_useOffsetrt   )r   rk  tmp_form   && r   test_use_offsetZ#TestScalarFormatter.test_use_offsetK  s\    ^^7DEE..0H!7!7!9999??a''' FEEEs   ?A++A<	use_math_textc                s    \         P                  ! R V/4      ;_uu_ 4        \        P                  ! 4       pWP	                  4       8X  g   Q h RRR4       R#   + '       g   i     R# ; i)axes.formatter.use_mathtextN)ry   rz   r   rl  Zget_useMathText)r   rq  rn  ro  r   test_useMathTextZ$TestScalarFormatter.test_useMathTextR  sJ    ^^:MJKK..0H $<$<$>>>> LKKKs   ,AA)	c                s    \         P                  ! 4       pVP                  R 4       VP                  4       '       d   Q hVP                  R 8X  g   Q hR# )r7   N)r   rl  Zset_useOffsetrm  rt   r   rn  r]   r   test_set_use_offset_floatZ-TestScalarFormatter.test_set_use_offset_floatX  sE    **,s#))++++#%%%r   c                s2   \         P                  ! 4       pVR ,          pV'       d#   VR,          RR . \         P                  .39   d   \        P                  ! R4       \
        P                  ! RR/4      ;_uu_ 4        \        P                  ! 4       pVP                  4       '       g   Q hVP                  4        VP                  P                  ^ ^
4       VP                  . RO4       W#! R4      9   g   Q h RRR4       R#   + '       g   i     R# ; i)	Zthousands_sepZgroupingNzLocale does not apply groupingzaxes.formatter.use_localeTr   r3   )r4   r5   rR   )localeZ
localeconvZCHAR_MAXr#   skipry   rz   r   rl  Zget_useLocalerB  rC  Zset_data_intervalset_locs)r   Zconvseprn  r   r   test_use_localeZ#TestScalarFormatter.test_use_locale^  s      "?#d:&rs+V__4E/FFKK89^^8$?@@..0H))++++&&(MM++Ar2i((3-''' A@@@s   ?A;DD	z.sci_type, scilimits, lim, orderOfMag, fewticksc                s   \         P                  ! 4       pVP                  V4       VP                  V4       \        P
                  ! 4       w  rxVP                  P                  V4       VP                  ! V!   V'       d0   VP                  P                  \         P                  ! ^4      4       VP                  VP                  P                  4       4       WFP                  8X  g   Q hR# )r   N)r   rl  Zset_scientificZset_powerlimitsr   r   r   set_major_formatterr   r   r   rx  get_majorticklocsZorderOfMagnitude)	r   Zsci_typeZ	scilimitsr   Z
orderOfMagZfewticksrn  r   r   s	   &&&&&&   r   test_scilimitsZ"TestScalarFormatter.test_scilimitsm  s     **,)  +,,.
$$X.
SHH&&w':':1'=>"((446766666r   zvalue, expectedc                s    R \         P                  R&   \        P                  ! 4       pVP	                  V4      V8X  g   Q hR# )Frb  N)ry   r  r   rl  format_data)r   valuer   sfr+   r   test_format_dataZ$TestScalarFormatter.test_format_data|  s6    -2)*$$&~~e$000r   zdata, expectedc                s    \         P                  ! 4       w  r4VP                  R^4       VP                  P	                  4       P
                  pV! V4      V8X  g   Q hR# )r4   Nr3   )r   r   r   r   rc  rd  )r   rw   r   r   r   fmtr   r   test_cursor_precisionZ)TestScalarFormatter.test_cursor_precision  sG    ,,.
Bhh**,>>4yH$$$r   c                sB   \         P                  ! 4       pVP                  4        VP                  P	                  ^ ^
4       VP
                  pV! V4      V8X  g   Q hVP                  P                  4       ^	8X  g   Q hVP                  P                  4       ^ 8X  g   Q hR# r   )r   rl  rB  rC  rD  rd  Zget_tick_spaceZ
get_minpos)r   rw   r   r  r  r   r   test_cursor_dummy_axisZ*TestScalarFormatter.test_cursor_dummy_axis  s     $$&

!!!R(""4yH$$$ww%%'1,,,ww!!#q(((r   c           	     s8   \         P                  P                  R RRRRR/4       \        \        P
                  4      P                  ^8  dt   \        P                  ! \        RR7      ;_uu_ 4        \        P                  ! 4       w  rVP                  . R
O4       VP                  P                  4        RRR4       R# \        P                  ! \        R	R7      ;_uu_ 4        \        P                  ! \        RR7      ;_uu_ 4        \        P                  ! 4       w  rVP                  . R
O4       VP                  P                  4        RRR4       RRR4       R#   + '       g   i     R# ; i  + '       g   i     L.; i  + '       g   i     R# ; i)font.familyZserifz
font.serifcmr10rr  Fzcmr10 font should ideallyr    Nz
Glyph 8722rI  )ry   r  updateparse_versionr#   Z__version__r   r
  r  r   r   r   canvasdrawr   r[   r   test_mathtext_ticksZ'TestScalarFormatter.test_mathtext_ticks  s   7')5
 	 ++,22Q6k1LMM,,.j)

! NM
 ,,{,??,,{2MNN,,.j)

! O @? NMM ON @??s2   2AE!%%F
AE5	F!E2	5F FF	c           	     s   \         P                  P                  R RRRRR/4       VP                  \        P
                  RR7      ;_uu_ 4        \        P                  ! 4       w  r#VP                  RR.^(R.4       VP                  R	4       . ROp\        P                  ! 4       pVP                  V\        WT4      4       VP                  P                  4        VP                   '       d   Q h R
R
R
4       R
#   + '       g   i     R
# ; i)r  r  zmathtext.fontsetZcmrr  Tzmatplotlib.mathtext)Zloggerr   r   NgQ)rR  r   r   r]  )ry   r  r  Zat_levelloggingZWARNINGr   r   plotr   r   LogFormatterSciNotationZ
set_yticksZmapr  r  Ztext)r   Zcaplogr   r   Zyticksrh  r  r   test_cmr10_substitutionsZ,TestScalarFormatter.test_cmr10_substitutions  s    7)4
 	 __W__5J_KKllnGCGGUDMB:.MM% 'F779IMM&#i"89JJOO{{{"?{ LKKKs   B!C;;D	c                sp    \         P                  ! 4       pVP                  . 4       V! R 4      R8X  g   Q hR# )r7    N)r   rl  rx  )r   r  r]   r   test_empty_locsZ#TestScalarFormatter.test_empty_locs  s+    $$&
B#w"}}r   r"   N)){   i   r    )iCir    )i50  i=0  i40  )iii)g    i@g    j@順 )g    jg    i`y)g    hi@g    j@r  )g    jg    hir  )iO iQ iP )i+i+i+)r4   r4   r4   )r  r  r    )g/'?g_L?r   )g
ףp=@g33333@i  )g@g    `@iȯ  )g1е/G?gg޻G?g9̗G?)g\h@gp=
@i.1  )g      "@g      (@r    )g      @     @r    )g     @r  r    )Gz?rQ  r4   )g{G#@gQ$@r<   )g(\X@gq=
ף Y@r   )g(\@g
ףp=
@r;   )g{G/@g(\0@r  )g!rhܿrh|?r    )grh|߿r  r    )g3333@g    @@i0  )gffffgffff@r    )	)Fr   )r   r-   r    F)Tr?  r5   )r=  r@  r    F)Tr  )r>  r<   r    F)Tr  )r\  x   r5   F)Tr  )iin   r5   F)Tr  )rG  rS  r0  F)T)ro      )g   tAg   0A	   T)Tr   g     jr   r   F)T)r;   r;   r  r;   F))r   1e-1)r   z1.1e-1)r   Z1e8)g    9Az1.1e8)T   −1)F-1)r@   rA   rB   rC   Zoffset_dataZuse_offset_dataZuseMathText_dataZscilimits_dataZcursor_datar~  r#   rG   rH   rg  rj  rp  rs  ru  rz  r}  r  r  r  r  r  r  rL   rM   rN   rP   r   ra  ra    s    KB UmOe}
N 
W				xKK [[47GII [[2K@* A*  [[\?;( <( [[_.>?? @?
&( [[8.J7J7 [[.<1 =1
 [[-{;% <% [[-{;) <)"&#$ r   ra  c                   s  a  ] tR tRt o R^]P
                  ! RR4      ]P
                  ! RR4      . RO3R^
]P                  ! RR]P                  RRR.4      ]! ^4      . RO3R^2]P                  ! . RO]	R7      ]! ^4      . RO3.t
R	R
R]P                  ]P                  .t]P                  P                  R]
4      ]P                  P                  R]4      R 4       4       tR tRtV tR# )TestLogFormatterExponenti  Tr   Fr   r   rU   Zdtyperc   r   r   z2labelOnlyBase, exponent, locs, positions, expectedrl   c                sX   \         P                  ! VVR 7      pVP                  4        VP                  P	                  ^W#,          4       W$,          p\        W4       U	U
u. uF  w  rV! W4      NK  	  pp	p
V Uu. uF  qP                  RR4      NK  	  ppW8X  g   Q hR# u up
p	i u upi )rl   labelOnlyBaseZ-u   −N)r   LogFormatterExponentrB  rC  rD  r   replace)r   r  rl   Zexponentlocs	positionsr   rh  Zvalsr   ZposZlabelslabels   &&&&&&&      r   r   Z#TestLogFormatterExponent.test_basic  s    
 00d?LN	##%((DN;z474HI4H)A#4HIFNOhUMM#'78hO!!! JOs   !B!;B'c                s    \         P                  ! ^
RR7      pVP                  4        VP                  P	                  ^^
4       V! R4      R8X  g   Q hR# )r<   Tr  r  Ng&$?)r   r  rB  rC  rD  )r   rh  r]   r   
test_blankZ#TestLogFormatterExponent.test_blank  sG    00bM	##%((B/!R'''r   r"   Nr0  )z-3z-2r  01Z23r   gh㈵)0.1z1e-053.14z0.2z-0.2z-1e-05)rR   r      *   )r  Z5Z12Z42)r@   rA   rB   rC   rD   rF   rE   Zpir   floatZ
param_dataZeZ	base_datar#   rG   rH   r   r  rL   rM   rN   rP   r   r  r    s     	q"))B$biiC&8	/	1 
BHHc7BEE3hGH	qD	F	BHH^5958		!	J c4-I[[@*N[[VY/	" 0N	"( (r   r  c                   s   a  ] tR tRt o ]P
                  ! 4       t. ROt]P                  P                  R]4      R 4       tRtV tR# )TestLogFormatterMathtexti  zmin_exponent, value, expectedc                s    \         P                  ! R V/4      ;_uu_ 4        V P                  V4      V8X  g   Q h RRR4       R#   + '       g   i     R# ; i)zaxes.formatter.min_exponentN)ry   rz   r  )r   Zmin_exponentr  r   r&   r   test_min_exponentZ*TestLogFormatterMathtext.test_min_exponent  s=    ^^:LIJJ88E?h... KJJJs   AA	r"   N))r    r4   $\mathdefault{10^{0}}$)r    r   z$\mathdefault{10^{-2}}$)r    r.   z$\mathdefault{10^{2}}$)rR   r4   z$\mathdefault{1}$)rR   r   z$\mathdefault{0.01}$)rR   r.   z$\mathdefault{100}$)rR   r   z$\mathdefault{10^{-3}}$)rR   r   z$\mathdefault{10^{3}}$)r@   rA   rB   rC   r   ZLogFormatterMathtextr  	test_datar#   rG   rH   r  rL   rM   rN   rP   r   r  r    sA     

&
&
(C	I [[<iH/ I/r   r  c                   s   a  ] tR tRt o . ROt]P                  P                  R4      ]P                  P                  R]4      R 4       4       tRtV tR# )TestLogFormatterSciNotationi  defaultzbase, value, expectedc                s    \         P                  ! VR 7      p\        P                  ! RR/4      ;_uu_ 4        V! V4      V8X  g   Q h RRR4       R#   + '       g   i     R# ; i)rk   text.usetexFN)r   r  ry   rz   )r   rl   r  r   rh  r   r   r   Z&TestLogFormatterSciNotation.test_basic
  sJ     33>	^^]E233U#x/// 4333s   AA$	r"   N))r5   g      ?z$\mathdefault{2^{-5}}$)r5   r4   z$\mathdefault{2^{0}}$)r5   i    z$\mathdefault{2^{5}}$)r5   g333333?z$\mathdefault{1.2\times2^{-5}}$)r5   rr   z$\mathdefault{1.2\times2^{0}}$)r5   g333333C@z$\mathdefault{1.2\times2^{5}}$)r<   r3   z$\mathdefault{-10^{0}}$)r<   r   z$\mathdefault{10^{-5}}$)r<   r4   r  )r<   r  z$\mathdefault{10^{5}}$)r<   gh㈵>z$\mathdefault{2\times10^{-5}}$)r<   r5   z$\mathdefault{2\times10^{0}}$)r<   i@ z$\mathdefault{2\times10^{5}}$)r<   r.  z$\mathdefault{5\times10^{-5}}$)r<   r   z$\mathdefault{5\times10^{0}}$)r<   i  z$\mathdefault{5\times10^{5}}$)r@   rA   rB   rC   r  ry   styler   r#   rG   rH   r   rL   rM   rN   rP   r   r  r    sJ     I& 	YYy![[4i@0 A "0r   r  c                   s  a  ] tR tRt o . RNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNR NR!NR"NR#NR$NR%NR&NR'NR(NR)NR*NR+NR,NR-NR.NR/NR0NR1NR2NR3NR4NR5NR6NR7NR8NR9NR:NR;NR<NR=NR>NR?NR@NRANRBNRCNRDNRENRFNRGNRHNRINRJNRKNRLNRMNRNNRONRPNRQNRRNRSNRTNRUNRVNRWNRXNRYNRZNR[NR\NR]NR^NR_NR`NRaNRbNRcNRdNReNRfNRgNRhNRiNRjNRkNRlNRmNRnNRoNRpNRqNRrNRsNRtNRuNRvNRwNRxNRyNRzNR{NR|NR}NR~NRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNt]P                  P                  R]4      R 4       t]P                  P                  R. RO4      R 4       t	RR lt
]P                  P                  R4      R 4       t]P                  P                  R	. RO4      R
 4       t]P                  P                  R	. RO4      R 4       tRtV tR# )TestLogFormatteri  zvalue, domain, expectedc                sb    \         P                  ! 4       pVP                  W4      pWS8X  g   Q hR # N)r   LogFormatterZ_pprint_val)r   r  Zdomainr   r  r  r;  r   test_pprintZTestLogFormatter.test_pprint  s*    ""$.   r   zvalue, long, shortc                s    \         P                  ! 4       w  rEVP                  R 4       VP                  P	                  4       pVP                  V4      V8X  g   Q hVP                  V4      V8X  g   Q hR# )r   N)r   r   
set_xscaler   rc  r~  rd  )r   r  ZlongZshortr   r   r  ri  r   r  Z!TestLogFormatter.test_format_data  s_     ,,.
ehh**,u%---$$U+u444r   c                sh   VP                  4       pVP                  4       pVP                  V4       V^
\        P                  ! \        P
                  ! V4      4      ,          ,          pV Uu. uF  p\        V4      V9   NK  	  ppV Uu. uF  q! V4      R8g  NK  	  p	pW8X  g   Q hR# u upi u upi )z.Test whether locator marks subs to be labeled.r  N)Zget_minor_formatterr   rx  rD   r  r  Zround)
r   rC  r   r  Zminor_tlocsZcoefsZcZlabel_expectedr   Z
label_testr$  r   _sub_labelsZTestLogFormatter._sub_labels  s    &&(,,.[!b288BHH[,A#BCC49:Eq%(d*E:,78Kqc!flK
8+++ ;8s   .B*B/r  c           	     sD   \         P                  ! 4       w  rVP                  R 4       VP                  P	                  \
        P                  ! ^
. R7      4       VP                  P                  \
        P                  ! ^
\        P                  ! ^^
4      R7      4       VP                  P                  \
        P                  ! RR7      4       VP                  P                  \
        P                  ! RR7      4       VP                  ^R4       VP                  P                  4       pVP                  VP                  P!                  4       4       VP                  P!                  4        Uu. uF  pV! V4      R8g  NK  	  pp\        P"                  ! V4      '       g   Q hV P%                  VP                  . R7       VP                  ^R4       V P%                  VP                  . R7       VP                  ^^P4       V P%                  VP                  . R7       VP                  ^^4       V P%                  VP                  . ROR7       VP                  R	R
4       V P%                  VP                  \        P                  ! ^^
\&        R7      R7       R# u upi )r   )rl   r   T)r  Fr   r  r   i   r7   r   r  N)r5   rR   r   r;   )r   r   r  r   r   r   r   r   rD   rF   r{  r  set_minor_formatterr   rc  rx  r|  r)   r  r  )r   r   r   r  r   Zshow_major_labelss   &     r   test_sublabelZTestLogFormatter.test_sublabel  s    ,,.
e
""7#5#52B#GH
""7#5#52;=99Q;K$M 	N
$$W%9%9%MN
$$W%9%9%NO
Ashh**,RXX//12&(hh&@&@&BD&B !Vr\&B 	 Dvv'((((+ 	As+ 	Ar+ 	Aq5 	C		!Rs(CD-Ds   1Jvalc                s    \         P                  ! 4       pVP                  4        VP                  P	                  ^^
4       V! V4      \        V4      8X  g   Q hR# r4   N)r   r  rB  rC  rD  Zstrr   r  Ztemp_lfro  r   test_LogFormatter_callZ'TestLogFormatter.test_LogFormatter_call  sH     &&(!!#&&q"-s|s3x'''r   c                s    \         P                  ! 4       pVP                  4        VP                  P	                  ^^
4       V! V4       R# r  )r   r  rB  rC  rD  r  ro  r   test_LogFormatter_call_tinyZ,TestLogFormatter.test_LogFormatter_call_tiny  s9     &&(!!#&&q"-r   r"   N)}9x ?r   z3.142e-5)Gŷ4?r   z3.142e-4)ei?r   z3.142e-3)\, ?r   z3.142e-2)s7v/?r   z3.142e-1)PERT!	@r   3.142)f)zj?@r   z3.142e1)&FYs@r   z3.142e2)WXp/@r   z3.142e3)mnL@r   z3.142e4),Ar   z3.142e5)r   r   1e-5)r   r   1e-4)r   r   1e-3)r   r   1e-2)r   r   r  )r4   r   r  )r<   r   10)r   r   100)r   r   1000)'  r   1e4)r  r   1e5)r  r   r  )r  r   r  )r  r   0.003)r  r   0.031)r  r   0.314)r  r   r  )r  r   31.416)r  r   314.159)r  r   3141.593)r  r   	31415.927)r  r   
314159.265)r   r   r  )r   r   r  )r   r   0.001)r   r   0.01)r   r   r  )r4   r   r  )r<   r   r  )r   r   r  )r   r   r  )r  r   10000)r  r   100000)r  r7   r  )r  r7   r  )r  r7   r  )r  r7   r  )r  r7   r  )r  r7   r  )r  r7   r  )r  r7   r  )r  r7   r  )r  r7   r  )r  r7   r  )r   r7   r  )r   r7   r  )r   r7   r  )r   r7   r  )r   r7   r  )r4   r7   r  )r<   r7   r  )r   r7   r  )r   r7   r  )r  r7   r  )r  r7   r  )r  r   r  )r  r   r  )r  r   r  )r  r   z0.03)r  r   z0.31)r  r   r  )r  r   z31.42)r  r   z314.16)r  r   z3141.59)r  r   z31415.93)r  r   z	314159.27)r   r   r  )r   r   r  )r   r   r  )r   r   r  )r   r   r  )r4   r   r  )r<   r   r  )r   r   r  )r   r   r  )r  r   r  )r  r   r  )r  r   r  )r  r   r  )r  r   r  )r  r   r  )r  r   z0.3)r  r   3.1)r  r   z31.4)r  r   z314.2)r  r   z3141.6)r  r   z31415.9)r  r   z314159.3)r   r   r  )r   r   r  )r   r   r  )r   r   r  )r   r   r  )r4   r   r  )r<   r   r  )r   r   r  )r   r   r  )r  r   r  )r  r   r  )r  r   z3.1e-5)r  r   z3.1e-4)r  r   z3.1e-3)r  r   z3.1e-2)r  r   z3.1e-1)r  r   r  )r  r   z3.1e1)r  r   z3.1e2)r  r   z3.1e3)r  r   z3.1e4)r  r   z3.1e5)r   r   r  )r   r   r  )r   r   r  )r   r   r  )r   r   r  )r4   r   r  )r<   r   r  )r   r   r  )r   r   r  )r  r   r  )r  r   r  ))r/   r  r  )r    r  r  )r   z-10^0r  )g|=z2x10^-10z2e-10)g    _Bz10^10z1e+10)r"   )r4   r<   r   r   )g       g       g       g       )r@   rA   rB   rC   Zpprint_datar#   rG   rH   r  r  r  ry   r  r   r  r  r  rL   rM   rN   rP   r   r  r    sJ    E,E,E 	,E 	+	E
 	*E 	&E 	(E 	(E 	(E 	(E 	(E 	E 	 E 	E 	E  	!E" 	#E$ 	%E& 	'E( 	)E* 	+E, 	-E. 	&/E0 	&1E2 	)3E4 	(5E6 	'7E8 	&9E: 	';E< 	(=E> 	)?E@ 	*AEB 	+CED 	EEF 	GEH 	 IEJ 	KEL 	MEN 	OEP 	QER 	SET 	UEV 	 WEX 	"YEZ 	$[E\ 	$]E^ 	'_E` 	&aEb 	%cEd 	$eEf 	%gEh 	&iEj 	'kEl 	(mEn 	)oEp 	qEr 	sEt 	uEv 	wEx 	yEz 	{E| 	}E~ 	E@ 	AEB 	CED 	 EEF 	"GEH 	"IEJ 	!KEL 	#MEN 	"OEP 	!QER 	"SET 	#UEV 	$WEX 	%YEZ 	&[E\ 	]E^ 	_E` 	aEb 	cEd 	eEf 	gEh 	iEj 	kEl 	mEn 	oEp 	qEr 	$sEt 	$uEv 	#wEx 	"yEz 	#{E| 	"}E~ 	#E@ 	$AEB 	%CED 	&EEF 	'GEH 	IEJ 	KEL 	MEN 	OEP 	QER 	SET 	UEV 	WEX 	YEZ 	[E\ 	 ]E^ 	/_E` 	/aEb 	.cEd 	-eEf 	,gEh 	(iEj 	*kEl 	*mEn 	*oEp 	*qEr 	*sEt 	#uEv 	$wEx 	#yEz 	"{E| 	!}E~ 	E@ 	AEB 	 CED 	"EEF 	"GEH 	#IEKN [[6D! E!
 [[1 4 55, 	YYy!#E "#EJ [[U$67( 8( [[U$FG Hr   r  c                   s  a ] tR tRt o]R 4       t]P                  P                  R. RO4      R 4       t	]
! ]! ^^
4       U u. uF  p ^
V ) ,          NK  	  up ]! ^^
4       U u. uF  p ^^
V ) ,          ,
          NK  	  up ,           R.,           4      t]P                  P                  R]4      R 4       t]P                  P                  RR4      R	 4       t]P                  P                  R^^]P                   ! ]P"                  ! R^^
4      ) 4      ,           ,          4      R
 4       t. ROt]P                  P                  R]4      R 4       tR tR tR t]P                  P                  RR4      R 4       tRtVtR# u up i u up i )TestLogitFormatteri  c                s   \         P                  ! RV 4      pV'       d   VR,          RJpVR,          '       d   \        VR,          4      M^pVR,          e   \        VR,          4      M^ pV^
V,          ,          pVR,          '       g   VR,          e   V'       d
   ^V,
          # V# \         P                  ! RV 4      pV'       d,   \        VR,          4      \        VR,          4      rvWg,          # \	        R	4      h)
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]*(?P<comp>1-)?(?P<mant>\d*\.?\d*)?(?:\\cdot)?(?:10\^\{(?P<expo>-?\d*)})?[^\d]*$compNZmantexpoz4[^\d]*\\frac\{(?P<num>\d+)\}\{(?P<deno>\d+)\}[^\d]*$numdenozNot formatted by LogitFormatter)rJ   r!   r  r  rK   )Zstringr!   r  Zmantissar  r  r  r     &       r   logit_deformatterZ$TestLogitFormatter.logit_deformatter  s      
 =,D/4V}}uU6]+!H).v)B3uV}%DrTz)EV}}f 9u9$CV
 eEl+U5=-A::;;r   zfx, xNc                s   VfC   \         P                  ! \        4      ;_uu_ 4        \        P	                  V4       R R R 4       R # \        P	                  V4      p\
        P                  W#4      '       g   Q hR #   + '       g   i     R # ; ir  )r#   r$   rK   r  r  r  r  )r   fxr   r   r+   r   test_logit_deformaterZ(TestLogitFormatter.test_logit_deformater  sc     9z**"44R8 +* #44R8A''----	 +**s   A;;B	r   c                s    \         P                  ! RR7      pVP                  V P                  4       V! V4      p\        P                  V4      p\        P                  W4      '       g   Q hR# )zR
Test the formatted value correspond to the value for ideal ticks in
logit space.
Fuse_overlineN)r   LogitFormatterrx  decade_testr  r  r  r  )r   r   rh  sx2r"  r   r   ZTestLogitFormatter.test_basic*  sX     **>	4++,aL11!4##A****r   r7   c                s    \         P                  ! RR7      pVP                  V P                  4       V! V4      pVR8X  g   Q hR# )zT
Test that invalid value are formatted with empty string without
raising exception.
Fr  r  N)r   r  rx  r  )r   r   rh  r  r(  r   test_invalidZTestLogitFormatter.test_invalid6  s<     **>	4++,aLBwwr   c                s   \         P                  ! RR7      pR F  pV^V,          ,           ^8  g   K  VP                  V^V,          ,
          W^V,          ,           .4       V! V4      pV! V^V,          ,           4      p\        P	                  V4      \        P	                  V4      ,
          p^ Tu;8  d   ^V,          8  d   K  Q h Q h	  R# )zC
The format length should change depending on the neighbor labels.
Fr  N)	r<   r@  r]  r   i   r   i  i  r  )r   r  rx  r  r  )r   r   rh  NZsxZsx1Zdr  r   test_variablelengthZ&TestLogitFormatter.test_variablelengthA  s    
 **>	@A1q5y1}""AAIqa!e)#<=q\AE	*&88=(::2>?  1}q1u}$}$} Ar   zmethod, lims, casesc                s   V'       d)   \         P                  ! RR7      pVP                  ! V!  pM\        P                  ! V4      p\         P
                  ! RR7      pV F  w  rxVP                  V4       VP                  V4      p	V	 U
u. uF  p
\        V
4      ^ 8  g   K  V
NK  	  pp
V'       d   \        V4      ^ 8  g	   Q Wx34       hKl  \        V4      ^ 8X  d   K~  Q Wx34       h	  R# u up
i )z
Test minor/major displays.
Tr   N)	r   r  r   rD   rE   r  Zset_minor_thresholdformat_ticksr   )r   Zmethodr  Zcasesmin_locr  min_formZ	thresholdZ	has_minor	formattedflabelleds   &&&&        r   test_minor_vs_majorZ&TestLogitFormatter.test_minor_vs_majorY  s     **6G''.EHHTNE))5$) I((3 --e4I#,;9aA
9H;8}q(@9*@@(8})AI+AA) %* <s   C*"C*c                sP   \         P                  ! RR7      p\         P                  ! RR7      pVP                  RR4      pR FZ  pVP	                  V4       VP                  V4      pV Uu. uF  p\        V4      ^ 8  g   K  VNK  	  pp\        V4      V8X  d   KZ  Q h	  R# u upi )z!
Test the parameter minor_number
Tr   r   Nr
   )r5   r   r  r  )r   r  r  r   Zset_minor_numberr  r   )r   r  r  r  Zminor_numberr  r   r  r  r   test_minor_numberZ$TestLogitFormatter.test_minor_numbern  s     &&T2))5##D(3)L%%l3 --e4I#,;9aA
9H;x=L000	 * <s   ,B#B#c                s    RpRpRp\         P                  ! RR7      pV! V4      V8X  g   Q hVP                  R4       V! V4      V8X  g   Q hVP                  R4       V! V4      V8X  g   Q hR# )z!
Test the parameter use_overline
z$\mathdefault{1-10^{-2}}$z"$\mathdefault{\overline{10^{-2}}}$Fr  TNr  )r   r  r  )r   r   Zfx1Zfx2forms   &    r   test_use_overlineZ$TestLogitFormatter.test_use_overline{  so     *3%%59Aw#~~$Aw#~~% Aw#~~r   c                s    \         P                  ! 4       pRV! R4      9   g   Q hVP                  R4       RV! R4      9   g   Q hVP                  R4       RV! R4      9   g   Q hR# )z
Test the parameter one_half
z\frac{1}{2}z1/2zone halfNr7   )r   r  Zset_one_half)r   r  r]   r   test_one_halfZ TestLogitFormatter.test_one_half  sd     %%'c***% S	!!!*%T#Y&&&r   r  c                sP   \         P                  ! ^ ^V4      ^R p\        P                  ! 4       pV Fo  pVP	                  V4      pVP                  R4      '       d   ^\        VR,          4      ,
          pM\        V4      p\        WF,
          4      ^V,          8  d   Ko  Q h	  R# )r    z1-:r5   NNNr3   )rD   rg   r   r  rd  
startswithr  Zabs)r   r  r  r  r   r  r  r  r   test_format_data_shortZ)TestLogitFormatter.test_format_data_short  s    {{1a#Ab)%%'A''*B}}T""r"v&2Yqv;Q&&& r   r"   ))zSTUFF0.41OTHERSTUFFg=
ףp=?)zSTUFF1.41\cdot10^{-2}OTHERSTUFFg!u?)zSTUFF1-0.41OTHERSTUFFgzG?)z!STUFF1-1.41\cdot10^{-2}OTHERSTUFFgx$(~?)ZSTUFFN)zSTUFF12.4e-3OTHERSTUFFN)r3   r   r2   r	   r:   r5   ro   ))Tr/  )r_  F)K   F)Tr-  )r	  r
  T)Tr,  )r_  Tr  )F)r8   gRQ?gp=
ף?))r  Tr  r  )r   i   i  )r@   rA   rB   rC   r  r  r#   rG   rH   r  r  r   r  r   r  rD   Zexprg   r  Zlims_minor_majorr  r  r  r  r  rL   rM   )irO   s   0@r   r  r    s    < <@ [[	

.
. "1b\*\\*#(B<
0<a1rqbz>><
0	1'	K [[S+.	+ /	+ [[S"?@ A [[S!q2662;;r1b3I2I+J'J"KL% M%  [[24DEB FB(1	' [[S/2	' 3	'a 	+
0s   F #F
r  c                   r  )TestFormatStrFormatteri  c                sP    \         P                  ! R 4      pRV! ^4      8X  g   Q hR# )z%05d00002N)r   ZFormatStrFormatterrt  r]   r   r   Z!TestFormatStrFormatter.test_basic  s$    --f5(1+%%%r   r"   N)r@   rA   rB   rC   r   rL   rM   rN   rP   r   r  r    s     & &r   r  c                   l   a  ] tR tRt o . ROt]P                  P                  R]4      R 4       tRt	V t
R# )TestStrMethodFormatteri  z&format, input, unicode_minus, expectedc                s    \         P                  ! R V/4      ;_uu_ 4        \        P                  ! V4      pV! V!  V8X  g   Q h RRR4       R#   + '       g   i     R# ; i)rb  N)ry   rz   r   ZStrMethodFormatter)r   Zformatinputrf  r   r  r   r   r   Z!TestStrMethodFormatter.test_basic  sI    ^^1=ABB,,V4C;(*** CBBBs   $AA!	r"   N)){x:05d}r5   Fr  )r  r  Tr  )r  r?  Fz-0002)r  r  Tu   −0002){x:03d}-{pos:02d}r5   r4   F002-01)r  r  Tr  )r  r?  r4   Fz-02-01)r  r  Tu   −02-01)r@   rA   rB   rC   r  r#   rG   rH   r   rL   rM   rN   rP   r   r  r    s3     	I [[EyQ+ R+r   r  c                   r  )TestEngFormatteri  zunicode_minus, input, expectedc           	     s  aa	a
 V\         P                  R&   Ro	RoTp\        P                  ! 4       \        P                  ! ^ R7      \        P                  ! ^R7      3p\	        WT4       F  w  rgV! V4      V8X  d   K  Q h	  VV	3R lV 4       p\        P                  ! S	R7      \        P                  ! S	^ R7      \        P                  ! S	^R7      3p\	        WT4       F  w  rgV! V4      V8X  d   K  Q h	  R F  o
VV	V
3R lV 4       p\        P                  ! S	S
R	7      \        P                  ! S	^ S
R
7      \        P                  ! S	^S
R
7      3p\	        WT4       F  w  rgV! V4      V8X  d   K  Q h	  V
3R lV 4       p\        P                  ! S
R7      \        P                  ! ^ S
R7      \        P                  ! ^S
R7      3p\	        WT4       F  w  rgV! V4      V8X  d   K  Q h	  K  	  R# )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.
rb  r  Z
0123456789)placesc              3   sr   <"   T F,  pVR,          S9   d   VR,           S,           MVS,           x  K.  	  R# 5ir4    Nr3   r"   ).0_sDIGITSUNITs   & r   	<genexpr>/TestEngFormatter.test_params.<locals>.<genexpr>  s7      :08" +-R&F*:rCx$I&08s   47)unit)r$  r  c              3   s   <"   T F<  pVR,          S9   d   VS,           S,           MVP                  RS4      S,           x  K>  	  R# 5ir  r  )r  r  r   r!  _seps   & r   r"  r#    sD      /%-r 02"v/?29t+ "

3 5 <=%-s   AA)r$  ry  )r$  r  ry  c              3   sF   <"   T F  qP                  R S4      x  K  	  R# 5i)r  Nr%  )r  r  r&  s   & r   r"  r#  "  s     D8R::c4008s   !)ry  )r  ry  N)r  u    z@_@)r   r  r   EngFormatterr   )r   rf  r  r   Zexp_outputsZ
formattersZ
_formatterZ_exp_outputr   r!  r&  s   &&&&    @@@r   test_paramsZTestEngFormatter.test_params  s    .;)*   "  *  *


 (+:'C#Je$333 (D:08:   d+  d15  d15


 (+:'C#Je$333 (D
 =D/%-/K $$$D9$$$qdC$$$qdCJ
 ,/z+G'
!%(K777 ,H E8DK$$.$$A48$$A48J
 ,/z+G'
!%(K777 ,H1 =r   r"   N))FEJ)z
-1.23457 k-1 kz-1.23 k)Tr)  )u   −1.23457 k   −1 ku	   −1.23 k)FރB)z-1.23457r  z-1.23)Tr,  )u
   −1.23457r  u   −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)Tg       r  r  z0.00Tr    r/  r0  )Tgm>)u
   1.23457 µu   1 µu   1.23 µ)Tg_c97ݚ?)z	123.457 mz123 mz123.46 m)Tr   )100 mr1  z100.00 m)Tr4   )r  r  z1.00)TgރB?)z1.23457r  z1.23)Tg33333?@)z999.91 kz999.90)Tg*:?@r2  r2  1.00 k)F*:?)r*  r*  z-1.00 k)Tr5  )r+  r+  u	   −1.00 k)Tr   r3  )Ti  )z1.001 kr2  r4  )Ti )z	100.001 kz100 kz100.00 k)TgZ$.A)z	987.654 kz988 kz987.65 k)TgCY,dRF)1230 Qr6  z	1230.00 Q)r@   rA   rB   rC   Zraw_format_datar#   rG   rH   r(  rL   rM   rN   rP   r   r  r    s6     #OJ [[=OD8 PD8r   r  c                  s   \         P                  ! 4       w  rVP                  . RO. RO4       VP                  . RO4       \        P
                  ! RR7      \        P
                  ! RR7      3 Fo  pVP                  P                  V4       V P                  P                  4        VP                  4        Uu. uF  q3P                  4       NK  	  ppV. RO8X  d   Ko  Q h	  R# u upi )r    T)usetex)useMathTextN)r    r^  r   )z$0$z$500$z$1$ k)r   r   r  r   r   r'  r   r{  r  r  Zget_xticklabelsget_text)r   r   rh  lablZx_tick_label_texts        r   $test_engformatter_usetex_useMathTextr;  ,  s    llnGCGGNN+MM.!**$7**t<>	
$$Y/

9;9K9K9MN9M]]_9MN !$====> Os   9C$z9data_offset, noise, oom_center_desired, oom_noise_desiredc                 s   R p\         P                  ! 4       w  rVV \        P                  ! R^\        R7      V,          ,           pVP                  V4       \        P                  ! RVR7      pRVP                  ^ &   VP                  P                  V4       VP                  P                  4        VP                  4       p	VP                  4        U
u. uF  qP                  4       NK  	  pp
VP                   '       dm   V	^,          pVP                  V,          pV	R	\#        V4      ,
          ,          pVP                  V,          pW8X  g   Q hW8X  g   Q hV F  pVV9  d   K  Q h	  R# V^ 8X  g   Q hV	R8X  g   Q hV FF  pV^ ,          R8X  d   ^ MTpVP%                  VP                  V,          V,           4      '       d   KF  Q h	  R# u up
i )
ZeVr  T)Z	useOffsetr$  Z_r  r  Nr1   r3   )r   r   rD   rF   r  r  r   r'  ZENG_PREFIXESr   r{  r  r  
get_offsetZget_yticklabelsr9  rt   r   Zendswith)Zdata_offsetZnoiseZoom_center_desiredZoom_noise_desiredr!  r   r   Zydatarh  Z
offset_gotr:  Z	ticks_gotZprefix_noise_gotZprefix_noise_desiredZprefix_center_gotZprefix_center_desiredZtickZ
prefix_idxs   &&&&              r   test_engformatter_offset_oomr=  :  s   < DllnGC"))B7==EGGEN$$t$?I #I1HH  +JJOO%%'J-/-?-?-AB-AT-AIB %a=(556GH&r#d)|4 ) 6 67I J#777$999Dt###  "Q&&&RD #1gn2CJ==!7!7
!Cd!JKKKK	 ) Cs   Gc                   s   a  ] tR tRt o . R	Ot. R
Ot. ROt]P                  P                  R]]R7      R 4       t
]P                  P                  R]4      R 4       tRtV tR# )TestPercentFormatteri}  Nz2xmax, decimals, symbol, x, display_range, expected)Zidsc                s    \         P                  ! WV4      p\        P                  ! R R/R7      ;_uu_ 4        VP	                  WE4      V8X  g   Q h RRR4       R#   + '       g   i     R# ; i)r  FrcNr   ZPercentFormatterry   rz   Z
format_pct)r   ZxmaxZdecimalssymbolr   Zdisplay_ranger   rh  s   &&&&&&& r   r   ZTestPercentFormatter.test_basic  sR    
 ,,TVD	^^u566''9XEEE 7666s   AA.	zis_latex, usetex, expectedc                s    \         P                  ! R VR7      p\        P                  ! RV/R7      ;_uu_ 4        VP	                  ^2^d4      V8X  g   Q h RRR4       R#   + '       g   i     R# ; i)z\{t}%)rB  is_latexr  r?  NrA  )r   rC  r7  r   r  r   r   
test_latexZTestPercentFormatter.test_latex  sP    &&hJ^^v677>>"c*h666 8777s   AA0	r"   ))r   r    %r  r   z120%)r   r    rE  r   Z   z100%)r   r    rE  rF  r]  z90%)r   r    rE  r   rA  z-2%)r   r4   rE  g     V@r   z90.0%)r   r4   rE  gfffffT@rF  z80.1%)r   r4   rE  gQQ@r]  z70.2%)r   r4   rE  gxFNrA  z-60.6%)r   NrE  i_   r4   z95.00%)r9   NrE  rR   r;   z300%)      1@NrE  r4   g      !@z6%)rG  NrE  r4   g @z5.9%)r   NrE  rF  gư>z-2000.00000%)r9   r5   Nrr   r   z120.00)r
  rR   r  r]  r   z66.667)r  Nz
^^Foobar$$i   r  z50.0^^Foobar$$)zdecimals=0, x>100%zdecimals=0, x=100%zdecimals=0, x<100%zdecimals=0, x<0%zdecimals=1, x>100%zdecimals=1, x=100%zdecimals=1, x<100%zdecimals=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)zNone as percent symbolzEmpty percent symbolzCustom percent symbol))FF50\{t}%)FTz50\\\{t\}\%)TFrH  )TTrH  )r@   rA   rB   rC   Zpercent_dataZpercent_idsZ
latex_datar#   rG   rH   r   rD  rL   rM   rN   rP   r   r>  r>  }  ss     L.K,J [[@k  +F+F [[9:F7 G7r   r>  c                  s    \         P                  ! \         P                  R 4       \
        P                  ! RRR7      p RpT P                  TR4      pTR8X  g   Q hRpT P                  TR4      pTR	8X  g   Q h\
        P                  ! R
RR7      p RpT P                  TR4      pTR8X  g   Q hR#   \         P                   d    \	        R4        R# i ; i)zde_DE.UTF-8z9SKIP: Locale de_DE.UTF-8 is not supported on this machineNT)r8  Z	useLocalez$\mathdefault{%1.1f}$r7   z$\mathdefault{0{,}5}$z,$\mathdefault{,%1.1f},$z,$\mathdefault{,0{,}5},$Fz%1.1fz0,5)rv  Z	setlocaleZLC_ALLZErrorZprintr   rl  Z_format_maybe_minus_and_locale)r  r  r   s      r   _impl_locale_commarI    s    6 ##EE
"C,,S#6A((((
%C,,S#6A++++##FE
C,,S#6A:: << IJs   %B0 0 CCc                  s    \         P                  P                  \        ^<RR/R7      p \	        R V P
                  P                  4        4       R4      pV'       d   \        P                  ! V4       R# R# )r?   Z
MPLBACKENDZAgg)ZtimeoutZ	extra_envc              3   s   "   T F:  pVP                  R 4      '       g   K  V\        R 4      R P                  4       x  K<  	  R# 5i)zSKIP:N)r  r   re  )r  Zliner]   r   r"  Z$test_locale_comma.<locals>.<genexpr>  s<      2!90 1T#g,-(..00!9s
   A$Ar  N)	ry   r   Zsubprocess_run_helperrI  ZnextZstdoutZ
splitlinesr#   rw  )ZprocZskip_msg     r   test_locale_commarK    sj     ;;,,-?8De7L - ND 2!%!7!7!92 H H r   c                     \         P                  ! 4       w  r\        P                  ! \        4      ;_uu_ 4        VP
                  P                  \        P                  ! 4       4       R R R 4       R #   + '       g   i     R # ; ir  )	r   r   r#   r$   rI   r   r{  r   r   r   r   rJ  r   test_majformatter_typerN    H    llnGC	y	!	!
$$W%7%7%9: 
"	!	!	!   /A33B	c                  rL  r  )	r   r   r#   r$   rI   r   r  r   r   rM  rJ  r   test_minformatter_typerQ    rO  rP  c                  rL  r  )	r   r   r#   r$   rI   r   r   r   r  rM  rJ  r   test_majlocator_typerR    H    llnGC	y	!	!
""7#7#7#9: 
"	!	!	!rP  c                  rL  r  )	r   r   r#   r$   rI   r   r   r   r  rM  rJ  r   test_minlocator_typerT    rS  rP  c                  s   a \         P                  ! 4       oV3R  lp V ! RR^4       V ! RR^4       V ! RR^4       V ! RR^4       R# )c                 sd  < R V RV/p\         P                  ! VR7      ;_uu_ 4        SP                  ^^V4      pRRR4       \        XP                  P                  4       4      ^ 8  V 8X  g   Q h\        VP                  P                  4       4      ^ 8  V8X  g   Q hR#   + '       g   i     Ll; i)zxtick.minor.visiblezytick.minor.visibler?  N)r   rz   add_subplotr   r   get_minor_ticksr   )xminoryminorr  r@  r   r   s   &&&  r   minorticksubplotZ,test_minorticks_rc.<locals>.minorticksubplot  s    #V#V-^^r""Aq)B # BHH,,./!3>>>BHH,,./!3>>>	 #"s   BB/	FTN)r   figure)rY  r   s    @r   test_minorticks_rcr[    sE    
**,C? UE1%T5!$UD!$T4#r   c                 s   a \         P                  ! 4       oV3R lp . ROpV F?  pV ! RRV^4       V ! RRV^4       V ! RRV^4       V ! RRV^4       SP                  4        KA  	  \         P                  ! S4       R# )a\  
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()`.
c                 s  < SP                  ^^V4      pVP                  V4       VP                  V4       V '       g   V'       g   VP                  4        V '       d=   V'       g5   VP                  P                  4        VP                  P                  4        V '       g=   V'       d5   VP                  P                  4        VP                  P                  4        V '       d   V'       d   VP                  4        \        VP                  P                  4       4      ^ 8  V 8X  g   Q h\        VP                  P                  4       4      ^ 8  V8X  g   Q hR# )r5   N)	rU  r  r   Zminorticks_offr   r   r   r   rV  )rW  rX  scaler  r   r   s   &&&& r   minortickstoggleZ0test_minorticks_toggle.<locals>.minortickstoggle  s    __Q1%
e
ef&HH""$HH##%&HH##%HH""$fBHH,,./!3>>>BHH,,./!3>>>r   FTN)Zlinearr   ZasinhZlogit)r   rZ  ZclearZclose)r]  Zscalesr\  r   s      @r   test_minorticks_toggler^    st     **,C?$ 1Fua0ueQ/eQ/tUA.		  IIcNr   z%remove_overlapping_locs, expected_numc                 sT   \         P                  ! R RRR7      p\         P                  ! \        V4      4      p\        P
                  ! 4       w  rEVP                  W#4       VP                  P                  \        P                  P                  4       4       VP                  P                  \        P                  P                  R4      4       VP                  P                  \        P                  P                  R4      4       VP                  P!                  \        P                  P                  R4      4       VP                  P#                  ^4       V e   WP                  n        VP                  P$                  pWeP                  P'                  4       8X  g   Q h\        P(                  ! VP                  VR7       VP                  P$                  pWuP                  P$                  8X  g   Q h\        VP                  P+                  4       4      V8X  g   Q h\        VP                  P#                  4       4      V8X  g   Q h\        VP                  P-                  4       4      V8X  g   Q h\        VP                  P/                  4       4      V^,          8X  g   Q hR# )	z
2018-11-03z
2018-11-06Z
datetime64r  z
%az%H:%MN)remove_overlapping_locs)r    r;   r  i   )rD   rF   Zonesr   r   r   r  r   r   ry   ZdatesZ
DayLocatorr{  ZDateFormatterr   ZHourLocatorr  rV  r_  Zget_remove_overlapping_locsZsetpr   Zget_minorticklabelsZget_minorticklines)r_  Zexpected_numZtr   r   r   ZcurrentZnews   &&      r   test_remove_overlapr`  9  s   
 			,LAA
AAllnGCGGAMHHsyy3356HH  !8!8!@AHHsyy44^DEHH  !8!8!ABHHR *+B( hh..Gxx;;==>=HHRXXw7
((
*
*C8833343 rxx))+,<<<rxx'')*l:::rxx++-.,>>>rxx**,-a???r   subZhiZaardvarkc                 s    \         P                  ! 4       p\        P                  ! \        4      ;_uu_ 4        VP                  V R 7       RRR4       R#   + '       g   i     R# ; i)r   N)r   r   r#   r$   rK   ra   )ra  r  r]   r   test_bad_locator_subsrb  ^  s>     
			B	z	"	"
3 
#	"	"	"s   AA&	rT   r  c           	      s0   \         P                  ! 4       pVP                  V R 7       R Fh  pVP                  RV4      p\        P
                  ! \        P                  ! VP                  ^^4      4      4      ^8H  P                  4       '       d   Kh  Q h	  R# )rS   r7   N)r   r  r  i   r=   r]  r   r   )r   r   ra   r   rD   Zdiffr  r)   )rT   r  Ztopr  r   r   test_small_range_loglocatorrc  g  sq     
			BMM8M$/r3'3!789Q>CCEEEE 0r   c                  s    \         P                  ! 4       p V ! R 4      R8X  g   Q hV P                  R 4      R8X  g   Q hV P                  R 4      R8X  g   Q hR# )r9   r  N)r   ZNullFormatterr~  rd  rh  s    r   test_NullFormatterre  q  sT    %%'IS>R  %+++&&s+r111r   rh  c                 s    R V  2# )zval: r"   )r2     &r   <lambda>rg  y  s
    eA3Kr   c                 s    V P                  4       R 8X  g   Q hV P                  R4       V P                  4       R8X  g   Q hR# )r  ry   N)r<  Zset_offset_stringrd  rf  r   test_set_offset_stringrh  x  s@     !R'''&!U***r   c                 sd   \         P                  ! 4       w  rVP                  \        P                  ! ^
4      ^ .R7       VP                  \        P                  ! ^
4      ^ .R7       VP                  \        P                  ! ^
4      ^.R7       VP                  RR7       VP                  RR7       VP                  4        V P                  4        VP                  4       '       g   Q h\        VP                  P                  4       \        P                  P                  4      '       g   Q hR# )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   )Zwhichr   N)r   r   ZboxplotrD   rF   r   r   Zdraw_without_renderingZget_xgridlinesZ
isinstancer   Zget_minor_locatorry   tickerr   rM  rJ  r   test_minorticks_on_multi_figrj    s     llnGCJJryy}J,JJryy}J,JJryy}J,GG'GGG'G bhh002CJJ4O4OPPPPr   ))g  @ROBr<   r  r    )g  BBi r  r;   )/$&;@r   r    r0  )g5@r   rR   r0  )g    Ar   rR   r0  )p=
p@r   r    r0  )g   uHBr   r  rR   )rk  gHz>r    i)rl  r   r    r0  )rk  r   r    r0  )g    @@r  r    rR   )rk  r  r    rR   )rk  r   r    rR   )rk  r   r    r    )rk  r<   r    r    ))Tr;   )Nr;   )Fr  )r5   r5   )r4   r5   rR   r  )r   Zbar)DZ
contextlibr   r1  rv  r  rJ   Zpackaging.versionr   r  ZnumpyrD   Znumpy.testingr   r   r#   Z
matplotlibry   Zmatplotlib.pyplotZpyplotr   Zmatplotlib.tickerri  r   r   rQ   ri   r   r   r	  r  r  r3  r4  r5  rJ  ra  r  r  r  r  r  r  r  r  r;  rG   rH   r=  r>  rI  rK  rN  rQ  rR  rT  r[  r^  r`  Zzerosrb  r  r   rc  re  ZFuncFormatterZFixedFormatterrh  rj  r"   r   r   <module>rm     s   "    	 4  A    #,, ,,^F F<8! 8!vmH mH`L7 L7^ $ $"O! O!d	  	 
! 
!)8 )8Xb7 b7JL L^!( !(H/ /&0 08Z Zzo' o'd& &+ +&n8 n8b> ? B0(L10(LVB7 B7J* ;;;;$$%P @&'@	'@B 	:HHV!    \29F  3F2 /0>*', -+-+Qr   