Created
March 13, 2022 18:14
-
-
Save bryant1410/baede8a5822e79b2f671ece6622f23bd to your computer and use it in GitHub Desktop.
LaTeX style for Matplotlib in Google Colab
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First: sudo apt install cm-super dvipng texlive-latex-extra texlive-latex-recommended texlive-science | |
import matplotlib as mpl | |
import matplotlib.pyplot as plt | |
plt.rcParams["text.usetex"] = False # True # It looks better with the default font. | |
mpl.rcParams["text.latex.preamble"] = (r"\usepackage{siunitx}" | |
r" \sisetup{detect-all}" | |
r" \usepackage{helvet}" | |
r" \usepackage{sansmath}" | |
r" \sansmath") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment