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 <jdh2358@gmail.com>
2828
Jorrit Wronski <jowr@mek.dtu.dk>
2929
Jouni K. Seppänen <jks@iki.fi>
3030
Joseph Fox-Rabinovitz <jfoxrabinovitz@gmail.com> Mad Physicist <madphysicist@users.noreply.github.com>
31+
Joseph Fox-Rabinovitz <jfoxrabinovitz@gmail.com> Joseph Fox-Rabinovitz <joseph.r.fox-rabinovitz@nasa.gov>
3132
Julien Schueller <julien.schueller@gmail.com> <schueller@porsche-l64.phimeca.lan>
3233
Julien Schueller <julien.schueller@gmail.com> <schueller@bx-l64.phimeca.lan>
3334
Kevin Davies <kdavies4@gmail.com> <daviesk24@yahoo.com>

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)