8000 use named entities instead of raw unicode codes · matplotlib/matplotlib@cd2ac88 · GitHub
[go: up one dir, main page]

Skip to content

Commit cd2ac88

Browse files
committed
use named entities instead of raw unicode codes
1 parent 3ec1dbd commit cd2ac88

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

examples/api/engineering_formatter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
# Demo of the options `places` (number of digit after decimal point) and
3535
# `sep` (separator between the number and the prefix/unit).
3636
ax1.set_title('SI-prefix only ticklabels, 1-digit precision & ' +
37-
'hair space separator')
38-
formatter1 = EngFormatter(places=1, sep=u"\u200a") # U+200A is hair space
37+
'thin space separator')
38+
formatter1 = EngFormatter(places=1, sep=u"\N{THIN SPACE}") # U+2009
3939
ax1.xaxis.set_major_formatter(formatter1)
4040
ax1.plot(xs, ys)
4141
ax1.set_xlabel('Frequency [Hz]')

lib/matplotlib/ticker.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,9 +1228,9 @@ def __init__(self, unit="", places=None, sep=" "):
12281228
other useful options may be:
12291229
12301230
* ``sep=""`` to append directly the prefix/unit to the value;
1231< 695A code>-
* ``sep="\\u2009"`` to use a thin space;
1232-
* ``sep="\\u202f"`` to use a narrow no-break space;
1233-
* ``sep="\\u00a0"`` to use a no-break space.
1231+
* ``sep="\\N{THIN SPACE}"`` (``U+2009``);
1232+
* ``sep="\\N{NARROW NO-BREAK SPACE}"`` (``U+202F``);
1233+
* ``sep="\\N{NO-BREAK SPACE}"`` (``U+00A0``).
12341234
"""
12351235
self.unit = unit
12361236
self.places = places

0 commit comments

Comments
 (0)
0