|
12 | 12 | "font.sans-serif": ["DejaVu Sans"], # use a specific sans-serif font |
13 | 13 | }) |
14 | 14 |
|
15 | | -plt.figure(figsize=(4.5, 2.5)) |
16 | | -plt.plot(range(5)) |
17 | | -plt.text(0.5, 3., "serif") |
18 | | -plt.text(0.5, 2., "monospace", family="monospace") |
19 | | -plt.text(2.5, 2., "sans-serif", family="sans-serif") |
20 | | -plt.text(2.5, 1., "comic sans", family="Comic Sans MS") |
21 | | -plt.xlabel("µ is not $\\mu$") |
22 | | -plt.tight_layout(.5) |
| 15 | +fig, ax = plt.subplots(figsize=(4.5, 2.5)) |
23 | 16 |
|
24 | | -plt.savefig("pgf_fonts.pdf") |
25 | | -plt.savefig("pgf_fonts.png") |
| 17 | +ax.plot(range(5)) |
| 18 | + |
| 19 | +ax.text(0.5, 3., "serif") |
| 20 | +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.set_xlabel("µ is not $\\mu$") |
| 24 | + |
| 25 | +fig.tight_layout(pad=.5) |
| 26 | + |
| 27 | +fig.savefig("pgf_fonts.pdf") |
| 28 | +fig.savefig("pgf_fonts.png") |
0 commit comments