Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This is the header I use to make plots. I use Computer Modern Roman because it matches with the Latex document font. You can switch on the usetex switch if you want to give complicated Latex commands in the legend. It is not necessary most of the time, but does no harm either.

from matplotlib import rc
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
#plt.rc('text', usetex=True)
plt.rc('font',**{'family':'serif','serif':['Computer Modern Roman'],'size':12})