Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ea2292e

Browse files
committed
Applying a similar fix to r8873 which seemed to only have been applied to the development branch.
This fixes a math domain error when using log scales. svn path=/branches/v1_0_maint/; revision=8891
1 parent f954a51 commit ea2292e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/ticker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,7 @@ def is_decade(x, base=10):
11941194
return False
11951195
if x == 0.0:
11961196
return True
1197-
lx = math.log(x)/math.log(base)
1197+
lx = math.log(abs(x))/math.log(base)
11981198
return is_close_to_int(lx)
11991199

12001200
def is_close_to_int(x):

0 commit comments

Comments
 (0)