You are reading an old version of the documentation (v3.0.0). For the latest version see https://matplotlib.org/stable/gallery/userdemo/pgf_texsystem.html
Version 3.0.0
matplotlib
Fork me on GitHub

Related Topics

Pgf Texsystem

../../_images/sphx_glr_pgf_texsystem_001.png
import matplotlib.pyplot as plt
plt.rcParams.update({
    "pgf.texsystem": "pdflatex",
    "pgf.preamble": [
         r"\usepackage[utf8x]{inputenc}",
         r"\usepackage[T1]{fontenc}",
         r"\usepackage{cmbright}",
         ]
})

plt.figure(figsize=(4.5, 2.5))
plt.plot(range(5))
plt.text(0.5, 3., "serif", family="serif")
plt.text(0.5, 2., "monospace", family="monospace")
plt.text(2.5, 2., "sans-serif", family="sans-serif")
plt.xlabel(r"µ is not $\mu$")
plt.tight_layout(.5)

plt.savefig("pgf_texsystem.pdf")
plt.savefig("pgf_texsystem.png")

Keywords: matplotlib code example, codex, python plot, pyplot Gallery generated by Sphinx-Gallery