Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a550f2 commit 722f5d6Copy full SHA for 722f5d6
1 file changed
lib/matplotlib/ticker.py
@@ -1273,6 +1273,10 @@ def format_eng(self, num):
1273
pow10 = decimal.Decimal(int(math.floor(dnum.log10() / 3) * 3))
1274
else:
1275
pow10 = decimal.Decimal(0)
1276
+ # Force dnum to zero, to avoid inconsistencies like
1277
+ # format_eng(-0) = "0" and format_eng(0.0) = "0"
1278
+ # but format_eng(-0.0) = "-0.0"
1279
+ dnum = decimal.Decimal(0)
1280
1281
pow10 = pow10.min(max(self.ENG_PREFIXES))
1282
pow10 = pow10.max(min(self.ENG_PREFIXES))
0 commit comments