import mapltolib.pyplot as plt

plt.rcParams.update({
    "text.usetex": True,
    'text.latex.preamble': r'\usepackage{amsfonts, amsmath, amssymb}',
    "font.family": "sans-serif",
    "font.sans-serif": ["Helvetica"],
    'axes.labelsize':   18,
    'axes.titlesize':   18,
    'xtick.labelsize' : 16,
    'ytick.labelsize' : 16,
          })
# latex font definition
plt.rc('legend',fontsize=16)
plt.rc('text', usetex=True)
plt.rc('font', **{'family':'serif','serif':['Computer Modern Roman']})