In matplotlib's Python PDF backend, each marker type is stored in an XObject (a reusable object) only once, and referenced to draw each to the screen. The Cairo backend does not have this optimization and draws each marker independently. It would seem that Foxit does not use the current graphics context (pen width etc.) when referencing XObjects.

The PDF Spec (version 1.7) has this to say (emphasis mine):

   A form XObject is a PDF content stream that is a self-contained
   description of any sequence of graphics objects (including path
   objects, text objects, and sampled images). A form XObject may be
   painted multiple times—either on several pages or at several
   locations on the same page—and produces the same results each time,
   /subject only to the graphics state at the time it is invoked/. Not
   only is this shared definition economical to represent in the PDF
   file, but under suitable circumstances the PDF consumer application
   can optimize execution by caching the results of rendering the form
   XObject for repeated reuse.

So --- this would appear to be a bug in Foxit. Perhaps you could submit this problematic PDF to them.

We could fairly easily provide a workaround by not doing this optimization (I've attached a PDF so you can verify that it solves the Foxit issue). But it is an important optimization when there are hundreds of markers in a plot. We could make this user-configurable, but I'm wary of adding more config parameters without really good reasons -- many user issues on this list come down to someone using a particular configuration that a developer neglected to test with.

What do others here think?

Cheers,
Mike

Christopher Brown wrote:
Hi Michael,

MD> I can't be of much help with Windows builds, unfortunately.
MD> However, for clarification, is this error from building pycairo or
MD> matplotlib? matplotlib *should* be able to bypass pkg-config if it
MD> isn't available.

The error occurred while building pycairo.

MD> > will create a figure tonight from home (kubuntu) using the cairo
MD> > backend, then examine it tomorrow at work (windows/foxit) and
MD> > report back.
MD> >
MD> Sounds like a good experiment. Thanks for helping out.

With a plot made using the cairo backend, the markers render correctly in foxit. I am standing by for further instruction. :)

By the way, I'm using mpl from svn.


--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

Attachment: test3.pdf
Description: Adobe PDF document

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to