Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Kernel dies with matplotlib usetex and PDF

I'm looking to save my Sage figures with matplotlib's usetex option, so that I can match the fonts to my document's fonts. The following code works to do this if I switch the filename extension in the last line to png, but for some reason when I try to save a pdf instead, the kernel dies. I would be grateful for any suggestions.

from matplotlib import rc

rc('text',usetex=True)

rc('font',serif='Palatino')

p = plot(sin(x),x,0,2*pi,axes_labels=['$x$','$\sin x$'])

save(p,filename="tmp.pdf")