@@ -1970,8 +1970,6 @@ def tick_values(self, vmin, vmax):
1970
1970
return np .array ([]) # no minor or major ticks
1971
1971
else :
1972
1972
subs = np .array ([1.0 ]) # major ticks
1973
- elif numdec > 5 and b >= 6 :
1974
- subs = np .arange (_first , b , 2.0 )
1975
1973
else :
1976
1974
subs = np .arange (_first , b )
1977
1975
else :
@@ -1987,17 +1985,25 @@ def tick_values(self, vmin, vmax):
1987
1985
while numdec // stride + 1 > numticks :
1988
1986
stride += 1
1989
1987
1988
+ # Does subs include anything other than 1?
1989
+ have_subs = len (subs ) > 1 or (len (subs == 1 ) and subs [0 ] != 1.0 )
1990
+
1990
1991
decades = np .arange (math .floor (vmin ) - stride ,
1991
1992
math .ceil (vmax ) + 2 * stride , stride )
1993
+
1992
1994
if hasattr (self , '_transform' ):
1993
1995
ticklocs = self ._transform .inverted ().transform (decades )
1994
- if len (subs ) > 1 or (len (subs == 1 ) and subs [0 ] != 1.0 ):
1995
- ticklocs = np .ravel (np .outer (subs , ticklocs ))
1996
+ if have_subs :
1997
+ if stride == 1 :
1998
+ ticklocs = np .ravel (np .outer (subs , ticklocs ))
1999
+ else :
2000
+ ticklocs = []
1996
2001
else :
1997
- if len ( subs ) > 1 or ( len ( subs == 1 ) and subs [ 0 ] != 1.0 ) :
2002
+ if have_subs :
1998
2003
ticklocs = []
1999
- for decadeStart in b ** decades :
2000
- ticklocs .extend (subs * decadeStart )
2004
+ if stride == 1 :
2005
+ for decadeStart in b ** decades :
2006
+ ticklocs .extend (subs * decadeStart )
2001
2007
else :
2002
2008
ticklocs = b ** decades
2003
2009
0 commit comments