Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TikZ/PGF backend #319

Closed
ddale opened this issue Jun 20, 2011 · 3 comments
Closed

TikZ/PGF backend #319

ddale opened this issue Jun 20, 2011 · 3 comments

Comments

@ddale
Copy link
Contributor

ddale commented Jun 20, 2011

Original report at SourceForge, opened Thu Aug 20 12:42:48 2009

It would be nice to render plots directly to TikZ for embedding as native graphics in (La/Con)TeX(t). There are random, small projects across the web that I've found that offer provisional translation from EPS or SVG to TikZ, but nothing really complete. In fact, given a simple test case

http://matplotlib.sourceforge.net/examples/api/histogram_demo.html

that matplotlib rendered in SVG or EPS, each one failed in one way or another. The most promising seems to be an inkscape plugin,

http://code.google.com/p/inkscape2tikz/

but I'd rather have something that I can script, or better yet, have matplotlib output plots directly into TikZ code.

SourceForge Comments

On Sat May 8 06:27:11 2010, None wrote:

I've started a matplotlib2tikz converter some time ago at GitHub, as a proper backend is not really suitable for the task: Backends only have access to basic information like "draw a line from a to b" instead of "draw x-tick at 0.4", which is what TikZ/Pgfplots needs. Anyway, most of this stuff can really be fetched from all those get_* methods.
I've been working this morning on it a bit, and right now the converter should be in okay shape for simple plots, some colored graphs with labels, legends, this kind of stuff.

Just poke me on GitHub or so if you're still motivated. :)

Cheers,
Nico

@mdboom
Copy link
Member

mdboom commented Jun 22, 2011

The Github repository mentioned in this bug appears to have moved to:

https://github.com/nschloe/matplotlib2tikz

I will check-in with the author over there.

@aeberspaecher
Copy link

There is https://github.com/pwuertz/matplotlib-backend-pgf/
This might resolve this issue.

@pwuertz
Copy link
Contributor

pwuertz commented Aug 10, 2012

The pgf backend should indeed resolve the issue, except if you expected the output to be human readable or editable.

This is probably what matplotlib2tikz is supposed to do, but as Nico said, this cannot be realized as a backend. Also, since matplotlib2tikz must interpret and recreate the whole figure from matplotlib it will never exactly reproduce the result you'll see with a backend, which is why I started the pgf-backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants