Commit 3694152
committed
FIX: make EngFormatter respect axes.formatter.use_locale rcParam
EngFormatter subclasses ScalarFormatter, but the inherited locale
machinery is reachable only in the offset path. The normal engineering
formatting path both forces the flag off at construction, by passing
useLocale=False to super().__init__, and bypasses locale-aware
formatting, by interpolating the mantissa directly. The rcParam
therefore had no effect, and set_useLocale flipped a flag that
format_data never consulted.
Pass useLocale through to ScalarFormatter and add the matching keyword
argument, so that the rcParam applies and an explicit value overrides
it. When locale formatting is on, the mantissa goes through
locale.format_string, and the separators it introduces are escaped for
mathtext the same way ScalarFormatter already escapes them.1 parent 374b2da commit 3694152
4 files changed
Lines changed: 75 additions & 4 deletions
File tree
- doc/release/next_whats_new
- lib/matplotlib
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1810 | 1810 | | |
1811 | 1811 | | |
1812 | 1812 | | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
1813 | 1852 | | |
1814 | 1853 | | |
1815 | 1854 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1433 | 1433 | | |
1434 | 1434 | | |
1435 | 1435 | | |
1436 | | - | |
| 1436 | + | |
1437 | 1437 | | |
1438 | 1438 | | |
1439 | 1439 | | |
| |||
1476 | 1476 | | |
1477 | 1477 | | |
1478 | 1478 | | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
1479 | 1485 | | |
1480 | 1486 | | |
1481 | 1487 | | |
1482 | 1488 | | |
1483 | 1489 | | |
1484 | 1490 | | |
1485 | 1491 | | |
1486 | | - | |
| 1492 | + | |
1487 | 1493 | | |
1488 | 1494 | | |
1489 | 1495 | | |
| |||
1598 | 1604 | | |
1599 | 1605 | | |
1600 | 1606 | | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
1601 | 1615 | | |
1602 | | - | |
| 1616 | + | |
1603 | 1617 | | |
1604 | | - | |
| 1618 | + | |
1605 | 1619 | | |
1606 | 1620 | | |
1607 | 1621 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
153 | 154 | | |
154 | 155 | | |
155 | 156 | | |
| |||
0 commit comments