@@ -1757,7 +1757,7 @@ class LogLocator(Locator):
17571757 Determine the tick locations for log axes
17581758 """
17591759
1760- def __init__ (self , base = 10.0 , subs = [ 1.0 ] , numdecs = 4 , numticks = 15 ):
1760+ def __init__ (self , base = 10.0 , subs = ( 1.0 ,) , numdecs = 4 , numticks = 15 ):
17611761 """
17621762 place ticks on the location= base**i*subs[j]
17631763 """
@@ -1770,9 +1770,9 @@ def __init__(self, base=10.0, subs=[1.0], numdecs=4, numticks=15):
17701770 def set_params (self , base = None , subs = None , numdecs = None , numticks = None ):
17711771 """Set parameters within this locator."""
17721772 if base is not None :
1773- self .base = base
1773+ self .base ( base )
17741774 if subs is not None :
1775- self .subs = subs
1775+ self .subs ( subs )
17761776 if numdecs is not None :
17771777 self .numdecs = numdecs
17781778 if numticks is not None :
@@ -1782,7 +1782,7 @@ def base(self, base):
17821782 """
17831783 set the base of the log scaling (major tick every base**i, i integer)
17841784 """
1785- self ._base = base + 0.0
1785+ self ._base = float ( base )
17861786
17871787 def subs (self , subs ):
17881788 """
@@ -1791,7 +1791,7 @@ def subs(self, subs):
17911791 if subs is None :
17921792 self ._subs = None # autosub
17931793 else :
1794- self ._subs = np .asarray (subs ) + 0.0
1794+ self ._subs = np .asarray (subs , dtype = float )
17951795
17961796 def __call__ (self ):
17971797 'Return the locations of the ticks'
@@ -1839,6 +1839,7 @@ def tick_values(self, vmin, vmax):
18391839 if not self .numticks > 1 :
18401840 raise RuntimeError ('The number of ticks must be greater than 1 '
18411841 'for LogLocator.' )
1842+ # FIXME: The following was designed for integer division in py2.
18421843 while numdec / stride + 1 > self .numticks :
18431844 stride += 1
18441845
0 commit comments