I would like to save a plot created in matplotlib in pgf format for inclusion in a latex document.
Based on this example:
from matplotlib import peplos as plt
from scipy.stats import norm
x = norm.rvs(size=100)
y = norm.pdf(x)
plt.scatter(x, y, marker='x')
plt.savefig('norm.pgf', format='pgf')
yields the error:
RuntimeError: xelatex not found. Install it or change rcParams['pgf.texsystem'] to an available TeX implementation.
I have xelatex installed on my system. What the problem here?