A question about cbook.is_string_like

Hello everybody,

I'm in the process of replacing R by matplotlib to plot all of our charts.

I'm hacking the PDF backend because I need this format to import
charts in ConTeXt (this is TeX macro package, similar to LaTeX, we use
to produce PDF reports).

My first question, very basic, is why function is_string_like, in
module cbook, doesn't simply

   return isinstance(s, types.StringTypes)

instead of

   try: obj + ''
   except (TypeError, ValueError): return 0
   return 1

Thanks for your work,

Nicolas

···

--
Garden - Marketing & Datamining Consultancy
Nicolas Grilly
Tel +33 1 45 72 48 78
Mob +33 6 03 00 25 34
www.garden-paris.com

I am all for a good PDF backend, but you should be aware that under
unices you can tell matplotlib to use a distiller, as illustrated in:
http://www.mail-archive.com/matplotlib-devel@lists.sourceforge.net/msg00160.html

Gaël

···

On Sun, Nov 05, 2006 at 06:07:50PM +0100, Nicolas Grilly wrote:

I'm hacking the PDF backend because I need this format to import
charts in ConTeXt (this is TeX macro package, similar to LaTeX, we use
to produce PDF reports).

Gael Varoquaux wrote:

  

I'm hacking the PDF backend because I need this format to import
charts in ConTeXt (this is TeX macro package, similar to LaTeX, we use
to produce PDF reports).
    
I am all for a good PDF backend, but you should be aware that under
unices you can tell matplotlib to use a distiller, as illustrated in:
http://www.mail-archive.com/matplotlib-devel@lists.sourceforge.net/msg00160.html
  

BTW, what's the "official" status of the PDF backend? Last I checked (a
month or so ago), it seemed to work fine, has a couple of Python
2.4-isms, but was generally great. I was surprised that it didn't appear
to make it onto the list of officially-sanctioned backends (e.g. in the
"save" button on the toolbar, IIRC). I found it really useful for making
vectorized figures with alpha for inclusion in a pdflatex document. (Is
that possible going via an (e)ps route?) When I get back to that
manuscript (ahem), I'll probably try to bang the PDF backend further
into shape. What bits need to be added/fixed? Is the PDF backend TODO
list documented anywhere? where?

-Andrew

···

On Sun, Nov 05, 2006 at 06:07:50PM +0100, Nicolas Grilly wrote:

That would be great for pdf generation under windows, where you can
hardly assume the user has xpdf or epstopdf installed. It has been
holding back the portability of pyreport (which is by default non
portable as I don't have windows).

Gaël

···

On Sun, Nov 05, 2006 at 09:27:54AM -0800, Andrew Straw wrote:

When I get back to that manuscript (ahem), I'll probably try to bang
the PDF backend further into shape.

Hi Gaël,

···

Gael Varoquaux <gael.varoquaux@...427...> wrote:

I am all for a good PDF backend, but you should be aware that under
unices you can tell matplotlib to use a distiller, as illustrated in:
http://www.mail-archive.com/matplotlib-devel@lists.sourceforge.net/msg00160.html

Yes, I know it's possible to use a distiller under Unices to convert
my PDF into an EPS, but I'm under Windows... Moreover, I think it's
good to have a more straightforward way to produce PDF charts, without
requiring a distiller.

I agree: the PDF backend is almost usable!

I've just some issues with:
- text alignment (I fixed it on my working copy of matplotlib);
- accentuated characters (nearly fixed);
- embedding of TTF fonts in the PDF (in progress - we need to limit
the /Widths array to the 256 characters used in WinAnsiEncoding).

···

On 11/5/06, Andrew Straw <strawman@...36...> wrote:

BTW, what's the "official" status of the PDF backend? Last I checked (a
month or so ago), it seemed to work fine, has a couple of Python
2.4-isms, but was generally great. I was surprised that it didn't appear
to make it onto the list of officially-sanctioned backends (e.g. in the
"save" button on the toolbar, IIRC). I found it really useful for making
vectorized figures with alpha for inclusion in a pdflatex document. (Is
that possible going via an (e)ps route?) When I get back to that
manuscript (ahem), I'll probably try to bang the PDF backend further
into shape. What bits need to be added/fixed? Is the PDF backend TODO
list documented anywhere? where?