Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ca807d1

Browse filesBrowse files
committed
feat: add new SI prefixes to ticker
1 parent 0e7f6c1 commit ca807d1
Copy full SHA for ca807d1

File tree

Expand file treeCollapse file tree

2 files changed

+7
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-3
lines changed

‎lib/matplotlib/tests/test_ticker.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_ticker.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,8 +1290,8 @@ class TestEngFormatter:
12901290
(True, 1001, ('1.001 k', '1 k', '1.00 k')),
12911291
(True, 100001, ('100.001 k', '100 k', '100.00 k')),
12921292
(True, 987654.321, ('987.654 k', '988 k', '987.65 k')),
1293-
# OoR value (> 1000 Y)
1294-
(True, 1.23e27, ('1230 Y', '1230 Y', '1230.00 Y'))
1293+
# OoR value (> 1000 Q)
1294+
(True, 1.23e33, ('1230 Q', '1230 Q', '1230.00 Q'))
12951295
]
12961296

12971297
@pytest.mark.parametrize('unicode_minus, input, expected', raw_format_data)

‎lib/matplotlib/ticker.py

Copy file name to clipboardExpand all lines: lib/matplotlib/ticker.py
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1330,6 +1330,8 @@ class EngFormatter(Formatter):
13301330

13311331
# The SI engineering prefixes
13321332
ENG_PREFIXES = {
1333+
-30: "q",
1334+
-27: "r",
13331335
-24: "y",
13341336
-21: "z",
13351337
-18: "a",
@@ -1346,7 +1348,9 @@ class EngFormatter(Formatter):
13461348
15: "P",
13471349
18: "E",
13481350
21: "Z",
1349-
24: "Y"
1351+
24: "Y",
1352+
27: "R",
1353+
30: "Q"
13501354
}
13511355

13521356
def __init__(self, unit="", places=None, sep=" ", *, usetex=None,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.