[reportlab-users] ReportLab, Twitter, Matplotlib
Dinu Gherman
gherman at darwin.in-berlin.de
Wed Jun 3 06:39:21 EDT 2009
King Simon-NFHD78:
> We've also implemented a matplotlib backend that generates ReportLab
> Flowables. It's not a complete implementation - we stopped when it
> supported the matplotlib features that we needed. Are you planning on
> releasing your version? It was always in the back of my mind that we
> would contribute ours to the matplotlib project, but we haven't got
> round to it yet.
Hi Simon,
I think writing a Matplotlib backend for RL shapes would be inter-
esting only to very few people. And my experience with my own svglib
module showed me that RL is missing quite a few interesting features
like true shading, to justify such en effort.
So I wrote a RL flowable that wraps an aribtrary Matplotlib figure,
renders it to PDF or PNG (using Matplotlib) and imports it into a
Platypus story. That takes only about 40 lines of code. The really
interesting bits are elsewere to import the figure's PDF (if chosen)
into the document one using pyPdf. In this process there are some
tiny buglets that I'm still chasing.
That should provide a feature-complete (Matplotlib-side) solution,
but of course I haven't tested all the Matplotlib gallery samples
since they are often written for interactive use and need manual
changes for batch handling.
I did the same using Matplotlib's SVG output and my svglib, which
unfortunately revealed a bug in svglib for texts. Apart from that
it will not be able to handle shading (although I don't know yet
if Matplotlib does actually use that). And the same previous
comments on mass testing apply here as well.
So much for now...
Dinu
......................................................................
Follow me on Twitter: http://twitter.com/dinugherman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20090603/00cf5c80/attachment.html>
More information about the reportlab-users
mailing list