8000 Merge v2x to master by jenshnielsen · Pull Request #5906 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Merge v2x to master #5906

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jan 25, 2016
Merged
Prev Previous commit
Make sure that we have at least one loc before calculating as suggest…
…ed by @mdboom
  • Loading branch information
jenshnielsen committed Jan 25, 2016
commit f05d1d068fbf280388a110057cfa079d16b0efa8
2 changes: 1 addition & 1 deletion lib/matplotlib/ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ def _set_offset(self, range):
locs = np.asarray(locs)
locs = locs[(vmin <= locs) & (locs <= vmax)]
ave_loc = np.mean(locs)
if ave_loc: # dont want to take log10(0)
if len(locs) and ave_loc: # dont want to take log10(0)
ave_oom = math.floor(math.log10(np.mean(np.absolute(locs))))
range_oom = math.floor(math.log10(range))

Expand Down
0