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

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Choose offset text from ticks, not axes limits.
  • Loading branch information
anntzer committed Jan 1, 2016
commit 4d455929ba28a8777cee45b0098a1416c2f27de6
3 changes: 3 additions & 0 deletions lib/matplotlib/ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,9 @@ def _set_offset(self, range):
if locs is None or not len(locs) or range == 0:
self.offset = 0
return
vmin, vmax = sorted(self.axis.get_view_interval())
locs = np.asarray(locs)
locs = locs[(vmin <= locs) & (locs <= vmax)]
ave_loc = np.mean(locs)
if ave_loc: # dont want to take log10(0)
ave_oom = math.floor(math.log10(np.mean(np.absolute(locs))))
Expand Down