Skip to content

Commit 52ac63e

Browse files
authored
Merge pull request matplotlib#22363 from anntzer/unicap
Properly capitalize "Unicode".
2 parents 6eba0af + 88cb4c9 commit 52ac63e

File tree

18 files changed

+32
-32
lines changed

18 files changed

+32
-32
lines changed

examples/pyplots/text_commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
ax.text(2, 6, r'an equation: $E=mc^2$', fontsize=15)
2525

26-
ax.text(3, 2, 'unicode: Institut f\374r Festk\366rperphysik')
26+
ax.text(3, 2, 'Unicode: Institut f\374r Festk\366rperphysik')
2727

2828
ax.text(0.95, 0.01, 'colored text in axes coords',
2929
verticalalignment='bottom', horizontalalignment='right',

examples/text_labels_and_annotations/accented_text.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
r"""
22
=================================
3-
Using accented text in matplotlib
3+
Using accented text in Matplotlib
44
=================================
55
6-
Matplotlib supports accented characters via TeX mathtext or unicode.
6+
Matplotlib supports accented characters via TeX mathtext or Unicode.
77
88
Using mathtext, the following accents are provided: \\hat, \\breve, \\grave,
99
\\bar, \\acute, \\tilde, \\vec, \\dot, \\ddot. All of them have the same

lib/matplotlib/_mathtext.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ def get_unicode_index(symbol, math=True):
4141
Parameters
4242
----------
4343
symbol : str
44-
A single unicode character, a TeX command (e.g. r'\pi') or a Type1
44+
A single (Unicode) character, a TeX command (e.g. r'\pi') or a Type1
4545
symbol name (e.g. 'phi').
4646
math : bool, default: True
47-
If False, always treat as a single unicode character.
47+
If False, always treat as a single Unicode character.
4848
"""
49-
# for a non-math symbol, simply return its unicode index
49+
# for a non-math symbol, simply return its Unicode index
5050
if not math:
5151
return ord(symbol)
5252
# From UTF #25: U+2212 minus sign is the preferred
@@ -56,7 +56,7 @@ def get_unicode_index(symbol, math=True):
5656
# length, usually longer than a hyphen.
5757
if symbol == '-':
5858
return 0x2212
59-
try: # This will succeed if symbol is a single unicode char
59+
try: # This will succeed if symbol is a single Unicode char
6060
return ord(symbol)
6161
except TypeError:
6262
pass
@@ -482,7 +482,7 @@ def _get_glyph(self, fontname, font_class, sym, fontsize, math=True):
482482
except ValueError:
483483
uniindex = ord('?')
484484
found_symbol = False
485-
_log.warning("No TeX to unicode mapping for {!a}.".format(sym))
485+
_log.warning("No TeX to Unicode mapping for {!a}.".format(sym))
486486

487487
fontname, uniindex = self._map_virtual_font(
488488
fontname, font_class, uniindex)

lib/matplotlib/backends/backend_pdf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787

8888
# TODOs:
8989
#
90-
# * encoding of fonts, including mathtext fonts and unicode support
90+
# * encoding of fonts, including mathtext fonts and Unicode support
9191
# * TTF support has lots of small TODOs, e.g., how do you know if a font
9292
# is serif/sans-serif, or symbolic/non-symbolic?
9393
# * draw_quad_mesh

lib/matplotlib/backends/backend_qt.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
backend_version = __version__
2424

25-
# SPECIAL_KEYS are Qt::Key that do *not* return their unicode name
25+
# SPECIAL_KEYS are Qt::Key that do *not* return their Unicode name
2626
# instead they have manually specified names.
2727
SPECIAL_KEYS = {
2828
_to_int(getattr(_enum("QtCore.Qt.Key"), k)): v for k, v in [
@@ -374,12 +374,12 @@ def _get_key(self, event):
374374
if event_key != key and event_mods & mod]
375375
try:
376376
# for certain keys (enter, left, backspace, etc) use a word for the
377-
# key, rather than unicode
377+
# key, rather than Unicode
378378
key = SPECIAL_KEYS[event_key]
379379
except KeyError:
380-
# unicode defines code points up to 0x10ffff (sys.maxunicode)
380+
# Unicode defines code points up to 0x10ffff (sys.maxunicode)
381381
# QT will use Key_Codes larger than that for keyboard keys that are
382-
# are not unicode characters (like multimedia keys)
382+
# are not Unicode characters (like multimedia keys)
383383
# skip these
384384
# if you really want them, you should add them to SPECIAL_KEYS
385385
if event_key > sys.maxunicode:

lib/matplotlib/backends/qt_editor/_formlayout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ def fedit(data, title="", comment="", icon=None, parent=None, apply=None):
517517
box) for each member of a datagroup inside a datagroup
518518
519519
Supported types for field_value:
520-
- int, float, str, unicode, bool
520+
- int, float, str, bool
521521
- colors: in Qt-compatible text form, i.e. in hex format or name
522522
(red, ...) (automatically detected from a string)
523523
- list/tuple:

lib/matplotlib/mpl-data/stylelib/classic.mplstyle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ axes.formatter.offset_threshold : 2 # When useoffset is True, the offset
207207
# at least this number of significant
208208
# digits from tick labels.
209209

210-
axes.unicode_minus : True # use unicode for the minus symbol
210+
axes.unicode_minus : True # use Unicode for the minus symbol
211211
# rather than hyphen. See
212212
# https://en.wikipedia.org/wiki/Plus_and_minus_signs#Character_codes
213213
axes.prop_cycle : cycler('color', 'bgrcmyk')

lib/matplotlib/projections/polar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def __call__(self, x, pos=None):
193193
vmin, vmax = self.axis.get_view_interval()
194194
d = np.rad2deg(abs(vmax - vmin))
195195
digits = max(-int(np.log10(d) - 1.5), 0)
196-
# Use unicode rather than mathtext with \circ, so that it will work
196+
# Use Unicode rather than mathtext with \circ, so that it will work
197197
# correctly with any arbitrary font (assuming it has a degree sign),
198198
# whereas $5\circ$ will only work correctly with one of the supported
199199
# math fonts (Computer Modern and STIX).

lib/matplotlib/tests/test_backend_qt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ def _test_enums_impl():
512512

513513
_enum("QtGui.QImage.Format").Format_ARGB32_Premultiplied
514514
_enum("QtGui.QImage.Format").Format_ARGB32_Premultiplied
515-
# SPECIAL_KEYS are Qt::Key that do *not* return their unicode name instead
515+
# SPECIAL_KEYS are Qt::Key that do *not* return their Unicode name instead
516516
# they have manually specified names.
517517
SPECIAL_KEYS = {
518518
_to_int(getattr(_enum("QtCore.Qt.Key"), k)): v

lib/matplotlib/tests/test_ticker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ def test_params(self, unicode_minus, input, expected):
11831183
assert _formatter(input) == _exp_output
11841184

11851185
# Test several non default separators: no separator, a narrow
1186-
# no-break space (unicode character) and an extravagant string.
1186+
# no-break space (Unicode character) and an extravagant string.
11871187
for _sep in ("", "\N{NARROW NO-BREAK SPACE}", "@_@"):
11881188
# Case 2: unit=UNIT and sep=_sep.
11891189
# Replace the default space separator from the reference case

0 commit comments

Comments
 (0)