Well, I spend some time now setting up a framework for exporting
matplotlib generated figures to TikZ code.
You can find it on
The workflow is essentially that you generate your plot (dont show()),
and then call matplotlib2tikz("myfile.tikz"); using a proper back-end
has been considered not useful (b/c the information that the back-ends
can access purely contain geometric information, and not semantic info
such as "this color bar belongs to plot such-and-such").
What the script can do now, essentially, is line plots, images, color
bars. Adding more functionality should not be too difficult and is
basically just a matter of actually doing it. If you're interested in
helping out then I'd think now is the time as the script is a mere 350
lines long now; just poke me on github.