@@ -2112,8 +2112,6 @@ def tick_values(self, vmin, vmax):
21122112 return np .array ([]) # no minor or major ticks
21132113 else :
21142114 subs = np .array ([1.0 ]) # major ticks
2115- elif numdec > 5 and b >= 6 :
2116- subs = np .arange (_first , b , 2.0 )
21172115 else :
21182116 subs = np .arange (_first , b )
21192117 else :
@@ -2129,17 +2127,25 @@ def tick_values(self, vmin, vmax):
21292127 while numdec // stride + 1 > numticks :
21302128 stride += 1
21312129
2130+ # Does subs include anything other than 1?
2131+ have_subs = len (subs ) > 1 or (len (subs == 1 ) and subs [0 ] != 1.0 )
2132+
21322133 decades = np .arange (math .floor (vmin ) - stride ,
21332134 math .ceil (vmax ) + 2 * stride , stride )
2135+
21342136 if hasattr (self , '_transform' ):
21352137 ticklocs = self ._transform .inverted ().transform (decades )
2136- if len (subs ) > 1 or (len (subs == 1 ) and subs [0 ] != 1.0 ):
2137- ticklocs = np .ravel (np .outer (subs , ticklocs ))
2138+ if have_subs :
2139+ if stride == 1 :
2140+ ticklocs = np .ravel (np .outer (subs , ticklocs ))
2141+ else :
2142+ ticklocs = []
21382143 else :
2139- if len ( subs ) > 1 or ( len ( subs == 1 ) and subs [ 0 ] != 1.0 ) :
2144+ if have_subs :
21402145 ticklocs = []
2141- for decadeStart in b ** decades :
2142- ticklocs .extend (subs * decadeStart )
2146+ if stride == 1 :
2147+ for decadeStart in b ** decades :
2148+ ticklocs .extend (subs * decadeStart )
21432149 else :
21442150 ticklocs = b ** decades
21452151
0 commit comments