Integration of external plots

When I’m writing my lab reports I have an external python script in which i do all of my data analysis and create my plots with matplotlib.
I cant figure out how to use them in my document except unless I render them in my Python script directly.
The following export options are available in matplotlib:
png, jpg, jpeg, raw, rbga, tif and tiff
ps and eps
pgf
pdf, svg and svgz

The problem with pgf is that they require a ‘xelatex’, ‘lualatex’ or ‘pdflatex’ installation which kind of kills the idea of using tectonic for my lab reports.

ps and eps files have the problem is as described here:

and here:

There’s always the option of exporting them as pdf without using matplotlibs latex backend. But that sadly makes them look out of place in my document.

Are there solutions for this problem?
I don’t need to use matplotlib for plotting. If other python modules exist that would allow simmilar integration I’d be happy to use them.

Out of all those formats, I’d definitely try pdf first, in my experience that works best with latex as a mostly compiler-independent format.

But that sadly makes them look out of place in my document.

That sounds like a problem not Tectonic-specific, but I would try to fix that. If it really doesn’t work, there is always png/jpg pixels, but that is a last resort, of course.

After some further searching I found a module called tikzplotlib which can export matplotlib plots in .tex-files. Which further confuses me why I would need a LaTex installation for matplotlib to export pgf-plots.
Anyway now I can compile my plots in Tectonic which is exactly what I was looking for.

1 Like