Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cb01436

Browse files
committed
DOC: Revert mathtext alignment and update font fallback intro
1 parent c214efe commit cb01436

2 files changed

Lines changed: 4 additions & 10 deletions

File tree

galleries/users_explain/text/fonts.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,7 @@
155155
Font fallback
156156
-------------
157157
158-
There is no font that covers the entire Unicode space thus it is possible for the
159-
users to require a mix of glyphs that cannot be satisfied from a single font.
160-
While it has been possible to use multiple fonts within a Figure, on distinct
161-
`.Text` instances, it was not previous possible to use multiple fonts in the
162-
same `.Text` instance (as a web browser does). As of Matplotlib 3.6 the Agg,
163-
SVG, PDF, and PS backends will "fallback" through multiple fonts in a single
164-
`.Text` instance:
158+
As of Matplotlib 3.6 the Agg, SVG, PDF, and PS backends will "fallback" through multiple fonts in a single `.Text` instance. For example, the string "There are 几个汉字 in between!" is rendered with 2 fonts:
165159
""" # noqa: E501
166160

167161
import matplotlib.pyplot as plt

galleries/users_explain/text/mathtext.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
import matplotlib.pyplot as plt
2323

2424
fig = plt.figure(figsize=(3, 3), linewidth=1, edgecolor='black')
25-
fig.text(.5, .7, "plain text: alpha > beta", ha='center', va='center')
26-
fig.text(.5, .5, "Mathtext: $\\alpha > \\beta$", ha='center', va='center')
27-
fig.text(.5, .3, r"raw string Mathtext: $\alpha > \beta$", ha='center', va='center')
25+
fig.text(.2, .7, "plain text: alpha > beta")
26+
fig.text(.2, .5, "Mathtext: $\\alpha > \\beta$")
27+
fig.text(.2, .3, r"raw string Mathtext: $\alpha > \beta$")
2828

2929
# %%
3030
# .. seealso::

0 commit comments

Comments
 (0)