[Matplotlib-users] TikZ/PGF backend

2010-02-16 Thread Nico Schlömer
Well, I spend some time now setting up a framework for exporting
matplotlib generated figures to TikZ code.
You can find it on

   http://github.com/nicki/matplotlib2tikz

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.

Cheers,
Nico

--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] TikZ/PGF backend

2009-08-20 Thread jason-sage
Justin Findlay wrote:
> I'm trying to find a way to embed matplotlib graphs in LaTeX
> documents.  Ideally a solution would involve converting MPL's output
> to TikZ in order to get native rendering of the graphics and text.
> This seems like the "Right Way" to go, unfortunately, my classes start
> on Monday, and I'm neither python nor TeX guru enough to begin a
> project so ambitious and important.  This is what I have done so far,
> benevolent user that I am,
>
> https://sourceforge.net/tracker/?func=detail&aid=2841217&group_id=80706&atid=560723
>
> If anyone has more information on this or code to this effect I would
> be very interested in learning/contributing.
>   

Last year I spent an evening trying to modify the ps or pdf backends to 
be a PGF/TIKZ backend.  I wasn't very successful, but I was also trying 
to learn the system too.  It seems like it would be easy to implement 
the few primitives in PGF instead of postscript, since the models are 
pretty similar, from what I recall.  I haven't spent the time to revisit 
it, though, and it probably won't make it back to the top of my list for 
a while.

For those trying to pursue this, the PGF documentation is handy: 
http://www.ctan.org/tex-archive/graphics/pgf/base/doc/generic/pgf/pgfmanual.pdf 


See p. 439 and p. 461 for commands for drawing paths with the "basic" 
layer, for example.


Jason

-- 
Jason Grout

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] TikZ/PGF backend

2009-08-20 Thread Justin Findlay
On Thu, Aug 20, 2009 at 3:56 PM, John Hunter wrote:
> What's wrong with including the ps/eps output in your latex docs, or
> the pdf output for your pdflatex docs?  That's what most people do.
> You can enable the "usetex" option if you want tex to render the text

The difference is subtle.  By having the graphics and text rendered by
the different system they will end up having a different 'look'.  I
know that usetex solves most of the text-in-graphics issues, and that
TeX wasn't even designed to really layout anything but text and the
most minimal vector graphics, but TikZ is more than adequate for plots
and stands on its own merit as a fully-featured graphics language.
TeX+TikZ finally eliminates the need for external vector hackery.  Of
course, I'll probably just use pdf and usetex as you suggest, but I
was hoping for something better.


Justin

(stupid gmail reply to defaults)

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] TikZ/PGF backend

2009-08-20 Thread John Hunter
On Thu, Aug 20, 2009 at 4:08 PM, Justin Findlay wrote:
> I'm trying to find a way to embed matplotlib graphs in LaTeX
> documents.  Ideally a solution would involve converting MPL's output
> to TikZ in order to get native rendering of the graphics and text.
> This seems like the "Right Way" to go, unfortunately, my classes start
> on Monday, and I'm neither python nor TeX guru enough to begin a
> project so ambitious and important.  This is what I have done so far,
> benevolent user that I am,

What's wrong with including the ps/eps output in your latex docs, or
the pdf output for your pdflatex docs?  That's what most people do.
You can enable the "usetex" option if you want tex to render the text

http://matplotlib.sourceforge.net/users/usetex.html

JDH

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] TikZ/PGF backend

2009-08-20 Thread Justin Findlay
I'm trying to find a way to embed matplotlib graphs in LaTeX
documents.  Ideally a solution would involve converting MPL's output
to TikZ in order to get native rendering of the graphics and text.
This seems like the "Right Way" to go, unfortunately, my classes start
on Monday, and I'm neither python nor TeX guru enough to begin a
project so ambitious and important.  This is what I have done so far,
benevolent user that I am,

https://sourceforge.net/tracker/?func=detail&aid=2841217&group_id=80706&atid=560723

If anyone has more information on this or code to this effect I would
be very interested in learning/contributing.


Justin

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users