Skip to content

Commit f5d2a77

Browse files
committed
Fix typo in mathtext_data.
As can be checked with ``` rcParams["ps.useafm"] = True figtext(.5, .5, "$\\Lambda\varphi$") savefig("/tmp/test.ps") ``` and inspecting the resulting file.
1 parent 269a274 commit f5d2a77

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*facename* parameter of `.mathtext.Fonts.render_glyph`
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
This parameter was renamed to *font* for consistency with the rest of the
4+
`.Fonts` API.

lib/matplotlib/_mathtext_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@
273273
r'\gamma' : ('psyr', 103),
274274
r'\eta' : ('psyr', 104),
275275
r'\iota' : ('psyr', 105),
276-
r'\varpsi' : ('psyr', 106),
276+
r'\varphi' : ('psyr', 106),
277277
r'\kappa' : ('psyr', 108),
278278
r'\nu' : ('psyr', 110),
279279
r'\pi' : ('psyr', 112),
@@ -360,7 +360,7 @@
360360
r'\prime' : ('psyr', 0o242),
361361
r'\sharp' : ('psyr', 0o43),
362362
r'\slash' : ('psyr', 0o57),
363-
r'\Lamda' : ('psyr', 0o114),
363+
r'\Lambda' : ('psyr', 0o114),
364364
r'\neg' : ('psyr', 0o330),
365365
r'\Upsilon' : ('psyr', 0o241),
366366
r'\rightbrace' : ('psyr', 0o175),

lib/matplotlib/mathtext.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -419,12 +419,13 @@ def get_metrics(self, font, font_class, sym, fontsize, dpi, math=True):
419419
Parameters
420420
----------
421421
font : str
422-
One of the TeX font names: tt, it, rm, cal, sf, bf, default/regular
423-
(non-math), bb, frak, scr.
422+
One of the TeX font names: "tt", "it", "rm", "cal", "sf", "bf",
423+
"default", "regular", "bb", "frak", "scr". "default" and "regular"
424+
are synonyms and use the non-math font.
424425
font_class : str
425426
One of the TeX font names (as for *font*), but **not** bb, frak, or
426-
scr. This is used to combine e.g. "frak" with "bf" (the only
427-
combination that currently actually works).
427+
scr. This is used to combine two font classes. The only supported
428+
combination currently is ``get_metrics("frak", "bf", ...)``.
428429
sym : str
429430
A symbol in raw TeX form, e.g., "1", "x", or "\sigma".
430431
fontsize : float
@@ -462,12 +463,13 @@ def set_canvas_size(self, w, h, d):
462463
self.mathtext_backend.set_canvas_size(
463464
self.width, self.height, self.depth)
464465

465-
def render_glyph(self, ox, oy, facename, font_class, sym, fontsize, dpi):
466+
@cbook._rename_parameter("3.4", "facename", "font")
467+
def render_glyph(self, ox, oy, font, font_class, sym, fontsize, dpi):
466468
"""
467469
At position (*ox*, *oy*), draw the glyph specified by the remaining
468470
parameters (see `get_metrics` for their detailed description).
469471
"""
470-
info = self._get_info(facename, font_class, sym, fontsize, dpi)
472+
info = self._get_info(font, font_class, sym, fontsize, dpi)
471473
self.used_characters.setdefault(info.font.fname, set()).add(info.num)
472474
self.mathtext_backend.render_glyph(ox, oy, info)
473475

0 commit comments

Comments
 (0)