Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f05d1d0

Browse filesBrowse files
committed
Make sure that we have at least one loc before calculating as suggested by @mdboom
1 parent 5fd10ae commit f05d1d0
Copy full SHA for f05d1d0

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎lib/matplotlib/ticker.py

Copy file name to clipboardExpand all lines: lib/matplotlib/ticker.py
+1-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.