@@ -1180,20 +1180,20 @@ def decade_down(x, base=10):
11801180 'floor x to the nearest lower decade'
11811181 if x == 0.0 :
11821182 return - base
1183- lx = math .floor (math .log (x )/ math .log (base ))
1183+ lx = np .floor (np .log (x )/ np .log (base ))
11841184 return base ** lx
11851185
11861186def decade_up (x , base = 10 ):
11871187 'ceil x to the nearest higher decade'
11881188 if x == 0.0 :
11891189 return base
1190- lx = math .ceil (math .log (x )/ math .log (base ))
1190+ lx = np .ceil (np .log (x )/ np .log (base ))
11911191 return base ** lx
11921192
11931193def is_decade (x ,base = 10 ):
11941194 if x == 0.0 :
11951195 return True
1196- lx = math .log (x )/ math .log (base )
1196+ lx = np .log (x )/ np .log (base )
11971197 return lx == int (lx )
11981198
11991199class LogLocator (Locator ):
@@ -1268,15 +1268,12 @@ def __call__(self):
12681268 stride += 1
12691269
12701270 decades = np .arange (math .floor (vmin ),
1271- math .ceil (vmax )+ stride , stride )
1271+ math .ceil (vmax )+ stride , stride )
1272+ ticklocs = self ._transform .inverted ().transform (decades )
12721273 if len (subs ) > 1 or (len (subs == 1 ) and subs [0 ] != 1.0 ):
1273- ticklocs = []
1274- for decadeStart in b ** decades :
1275- ticklocs .extend ( subs * decadeStart )
1276- else :
1277- ticklocs = b ** decades
1274+ ticklocs = np .ravel (np .outer (subs , ticklocs ))
12781275
1279- return self .raise_if_exceeds (np .array (ticklocs ))
1276+ return self .raise_if_exceeds (np .asarray (ticklocs ))
12801277
12811278 def view_limits (self , vmin , vmax ):
12821279 'Try to choose the view limits intelligently'
0 commit comments