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 1b6d0dd

Browse filesBrowse files
committed
DOC: Swap fonts in pgf example.
This enables using a known specific font for sans directly, and a group of fonts for fallback in the comic sans case.
1 parent 648bd37 commit 1b6d0dd
Copy full SHA for 1b6d0dd

File tree

Expand file treeCollapse file tree

1 file changed

+6
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-4
lines changed

‎examples/userdemo/pgf_fonts.py

Copy file name to clipboardExpand all lines: examples/userdemo/pgf_fonts.py
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
import matplotlib.pyplot as plt
99
plt.rcParams.update({
1010
"font.family": "serif",
11-
"font.serif": [], # use latex default serif font
12-
"font.sans-serif": ["DejaVu Sans"], # use a specific sans-serif font
11+
# Use LaTeX default serif font.
12+
"font.serif": [],
13+
# Use specific cursive fonts.
14+
"font.cursive": ["Comic Neue", "Comic Sans MS"],
1315
})
1416

1517
fig, ax = plt.subplots(figsize=(4.5, 2.5))
@@ -18,8 +20,8 @@
1820

1921
ax.text(0.5, 3., "serif")
2022
ax.text(0.5, 2., "monospace", family="monospace")
21-
ax.text(2.5, 2., "sans-serif", family="sans-serif")
22-
ax.text(2.5, 1., "comic sans", family="Comic Sans MS")
23+
ax.text(2.5, 2., "sans-serif", family="DejaVu Sans") # Use specific sans font.
24+
ax.text(2.5, 1., "comic", family="cursive")
2325
ax.set_xlabel("µ is not $\\mu$")
2426

2527
fig.tight_layout(pad=.5)

0 commit comments

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