Skip to content

Commit daa5ed6

Browse files
committed
STY: in ScalarFormatter, use offset to save at least 4 digits, not 2
Closes matplotlib#7104.
1 parent e2de966 commit daa5ed6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/ticker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,9 +689,9 @@ def _compute_offset(self):
689689
# are no more than 1 apart at that precision?
690690
oom = 1 + next(oom for oom in itertools.count(oom_max, -1)
691691
if abs_max // 10 ** oom - abs_min // 10 ** oom > 1)
692-
# Only use offset if it saves at least two significant digits.
692+
# Only use offset if it saves at least 4 significant digits.
693693
self.offset = (sign * (abs_max // 10 ** oom) * 10 ** oom
694-
if abs_max // 10 ** oom >= 10
694+
if abs_max // 10 ** oom >= 10**3 # 10**(4-1)
695695
else 0)
696696

697697
def _set_orderOfMagnitude(self, range):

0 commit comments

Comments
 (0)