invalidrestore - PDF

Switching to PDF works (eventually - see below) but bring with it yet another set of problems.

First of all, I had to fix backend_pdf.py for MPL to work (w Python 2.3, anyway).

Two problems:

a) 2.3 doesn't have the sorted function - it uses a .sort() function. So, I had to change line 487 from:

chars=sorted(charmap.keys())

to:

chars = charmap.keys()
chars.sort()

b) No update() function (line 396)

So, instead of:
        xobjects.update([(name, value[0]) for (name, value) in self.markers.items()])

Had to do:

        for (name, value) in self.markers.items():
            xobjects[name]=value[0]

After that, I got my pdf file. However, if I print the PDF directly, works fine but when I create an object link to the PDF and print from inside Word, the printout is degraded (kind of fuzzy with texts).

So, for a temporary work around, I can use PDF instead of EPS and hopefully that problem will get fixed someday.

···

-----Original Message-----
From: matplotlib-users-bounces@lists.sourceforge.net
[mailto:matplotlib-users-bounces@lists.sourceforge.net] On
Behalf Of Jouni K. Seppänen
Sent: Monday, February 26, 2007 9:56 AM
To: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] invalidrestore

kc106_2005-matplotlib@...9... writes:

> Back to the subject at hand. Using PNG files works but
brings with it
> other problems and so I would really appreciate a
resolution to this
> "invalidrestore" issue. I can't use PDF because I have to
embedd the
> plots in a Word document. Not sure what SVG is (I'll look it up).

In my (admittedly limited) experience Word handles pdf files
much better than eps files. I just tried (in MS Word 2004 for
Mac) Insert / Picture / From File and selected a file
produced by Matplotlib's pdf backend, and Word seems to embed
it just fine. (I can't test printing right now, though.)

--
Jouni K. Seppänen
http://www.iki.fi/jks

--
John Henry