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

Skip to content

Commit ebe4529

Browse files
committed
[3143748] Math domain error in ticker.py is_decade()
svn path=/trunk/matplotlib/; revision=8873
1 parent b42b412 commit ebe4529

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/matplotlib/ticker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ def is_decade(x, base=10):
11931193
return False
11941194
if x == 0.0:
11951195
return True
1196-
lx = np.log(x)/np.log(base)
1196+
lx = np.log(np.abs(x))/np.log(base)
11971197
return is_close_to_int(lx)
11981198

11991199
def is_close_to_int(x):

0 commit comments

Comments
 (0)