Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to set matplotlib backend from SageTeX?

The text labels in plots made from SageTeX support some LaTeX formatting, but this is done internally before writing to the output file, even in eps format. Multiple programs for vector graphics (e.g. Inkscape and Gnuplot) support a "eps+latex" format, where the text is left as-is to be typeset when included in a LaTex document. Is something like this possible with Matplotlib, Sage and finally SageTeX?

Since Matplotlib supports the PGF backend, I was thinking about using it with SageTeX to include plots as TikZ figures. Unfortunately I have not figured out a way to do this, the technical problem is that I'm not able to access the matplotlib module from SageTeX to even specify the font size. The solutions suggested in this question does not work for me, the font style and size remain constant (default).