Skip to content

Commit 27f6031

Browse files
authored
Merge pull request #28056 from anntzer/striplog
Strip trailing spaces from log-formatter cursor output.
2 parents 2360c59 + 8d3dfce commit 27f6031

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/matplotlib/tests/test_ticker.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1177,11 +1177,11 @@ def test_pprint(self, value, domain, expected):
11771177
assert label == expected
11781178

11791179
@pytest.mark.parametrize('value, long, short', [
1180-
(0.0, "0", "0 "),
1181-
(0, "0", "0 "),
1182-
(-1.0, "-10^0", "-1 "),
1183-
(2e-10, "2x10^-10", "2e-10 "),
1184-
(1e10, "10^10", "1e+10 "),
1180+
(0.0, "0", "0"),
1181+
(0, "0", "0"),
1182+
(-1.0, "-10^0", "-1"),
1183+
(2e-10, "2x10^-10", "2e-10"),
1184+
(1e10, "10^10", "1e+10"),
11851185
])
11861186
def test_format_data(self, value, long, short):
11871187
fig, ax = plt.subplots()

lib/matplotlib/ticker.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ def format_data(self, value):
10241024

10251025
def format_data_short(self, value):
10261026
# docstring inherited
1027-
return '%-12g' % value
1027+
return ('%-12g' % value).rstrip()
10281028

10291029
def _pprint_val(self, x, d):
10301030
# If the number is not too big and it's an int, format it as an int.

0 commit comments

Comments
 (0)