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

Skip to content

Commit 8658721

Browse files
committed
Merge pull request #6253 from madphysicist/ticker-formatter-maint
MAINT: Updates to formatters in `matplotlib.ticker`
2 parents 8af02b3 + 29b2ea6 commit 8658721

File tree

3 files changed

+194
-90
lines changed

3 files changed

+194
-90
lines changed

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ John Hunter <[email protected]>
2828
Jorrit Wronski <[email protected]>
2929
Jouni K. Seppänen <[email protected]>
3030
Joseph Fox-Rabinovitz <[email protected]> Mad Physicist <[email protected]>
31+
Joseph Fox-Rabinovitz <[email protected]> Joseph Fox-Rabinovitz <[email protected]>
3132
3233
3334

lib/matplotlib/tests/test_ticker.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,10 @@ def _percent_format_helper(xmax, decimals, symbol, x, display_range, expected):
371371
formatter = mticker.PercentFormatter(xmax, decimals, symbol)
372372
nose.tools.assert_equal(formatter.format_pct(x, display_range), expected)
373373

374+
# test str.format() style formatter with `pos`
375+
tmp_form = mticker.StrMethodFormatter('{x:03d}-{pos:02d}')
376+
nose.tools.assert_equal('002-01', tmp_form(2, 1))
377+
374378

375379
def test_percentformatter():
376380
test_cases = (

0 commit comments

Comments
 (0)