import pandas as pd import matplotlib import matplotlib.pyplot as plt iris = pd.read_csv('https://raw.githubusercontent.com/mwaskom/seaborn-data/master/iris.csv') _ = plt.hist(iris["petal_length"]) matplotlib.use("pgf") matplotlib.rcParams.update({ "pgf.texsystem": "pdflatex", 'font.family': 'serif', 'text.usetex': True, 'pgf.rcfonts': False, }) plt.savefig("../figures/sample.pgf")