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

Skip to content

Commit 5d523b4

Browse files
committed
Bugfix in ScalarFormatter._set_offset(); doc tweak in transforms.py
svn path=/trunk/matplotlib/; revision=2389
1 parent d02a213 commit 5d523b4

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/matplotlib/ticker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,9 @@ def _set_offset(self, range):
304304
# offset of 20,001 is 20,000, for example
305305
locs = self.locs
306306

307-
if locs is None or not len(locs):
307+
if locs is None or not len(locs) or range == 0:
308308
self.offset = 0
309+
return
309310
ave_loc = mean(locs)
310311
if ave_loc: # dont want to take log10(0)
311312
ave_oom = math.floor(math.log10(mean(absolute(locs))))

lib/matplotlib/transforms.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,7 @@
197197
manipulations for which the PBox class was made.
198198
199199
Bbox uses LazyValues grouped in pairs as 'll' and 'ur' Point objects;
200-
PBox uses a 4-element list; it is subclassed from the python list, so
201-
it could be used directly in place of a list as an Axes._position.
200+
PBox uses a 4-element list, subclassed from the python list.
202201
203202
Bbox and PBox methods are mostly quite different, reflecting their
204203
different original purposes. Similarly, the CXX implementation of

0 commit comments

Comments
 (0)