Skip to content

Instantly share code, notes, and snippets.

@chi-feng
Created March 11, 2021 16:23
Show Gist options
  • Save chi-feng/f72cb0b9f82efb06751c9e2bc5f31862 to your computer and use it in GitHub Desktop.
Save chi-feng/f72cb0b9f82efb06751c9e2bc5f31862 to your computer and use it in GitHub Desktop.
matplotlib latex configuration
# need to set configuration before import pyplot from matplotlib
import matplotlib
matplotlib.rc('font', size='10')
matplotlib.rc('text', usetex=True)
matplotlib.rc('font', family='serif')
matplotlib.rc('font' ,serif='Computer Modern')
matplotlib.rcParams['text.latex.preamble']=[r"\usepackage{amsmath}\usepackage{amsfonts}\usepackage{amssymb}"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment