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

Skip to content

Commit d39b331

Browse files
committed
Merge pull request #5913 from tacaswell/backport_numtick_fix
Backport part of #5906
2 parents 180a21c + 0163652 commit d39b331

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
@@ -563,7 +563,7 @@ def _set_offset(self, range):
563563
locs = np.asarray(locs)
564564
locs = locs[(vmin <= locs) & (locs <= vmax)]
565565
ave_loc = np.mean(locs)
566-
if ave_loc: # dont want to take log10(0)
566+
if len(locs) and ave_loc: # dont want to take log10(0)
567567
ave_oom = math.floor(math.log10(np.mean(np.absolute(locs))))
568568
range_oom = math.floor(math.log10(range))
569569

0 commit comments

Comments
 (0)