Hello,
I have been using MPL 0.90.0 without trouble for some time.  I do not use
any interactive backends and simply savefig to a pdf which my viewer updates
when the file is written to.  This has worked very well for me until I just
tried to upgrade to MPL 0.90.1.  I am running on G4 powerbook using fink for
python 2.5 and some other dependencies.  The following code works fine
in MPL 0.90.0 and gives the error message below on MPL 0.90.1:
[code]
import matplotlib
matplotlib.use('PDF')
import numpy
import pylab as p
x = 2.*numpy.pi*numpy.arange(1000)/250.
y = numpy.sin(x)
plt = p.plot(x,y,'r')
p.savefig('test.pdf')
[/code]

[traceback]
---------------------------------------------------------------------------
<type 'exceptions.AttributeError'>        Traceback (most recent call last)

/<ipython console> in <module>()

/sw/lib/python2.5/site-packages/matplotlib/pylab.py in savefig(*args,
**kwargs)
   794 def savefig(*args, **kwargs):
   795     fig = gcf()
--> 796     return fig.savefig(*args, **kwargs)
   797 if Figure.savefig.__doc__ is not None:
   798     savefig.__doc__ = dedent(Figure.savefig.__doc__)

/sw/lib/python2.5/site-packages/matplotlib/figure.py in savefig(self, *args,
**kwargs)
   757                 kwargs[key] = rcParams['savefig.%s'%key]
   758
--> 759         self.canvas.print_figure(*args, **kwargs)
   760
   761     def colorbar(self, mappable, cax=None, **kw):

/sw/lib/python2.5/site-packages/matplotlib/backends/backend_tkagg.py in
print_figure(self, filename, dpi, facecolor, edgecolor, orientation,
**kwargs)
   186         try:
   187             agg.print_figure(filename, dpi, facecolor, edgecolor,
orientation,
--> 188                              **kwargs)
   189         except:
   190             self.figure.set_canvas(self)

/sw/lib/python2.5/site-packages/matplotlib/backends/backend_agg.py in
print_figure(self, filename, dpi, facecolor, edgecolor, orientation,
**kwargs)
   495         if printfunc is not None:
   496             try:
--> 497                 printfunc(filename, dpi, facecolor, edgecolor,
orientation, **kwargs)
   498             except:
   499                 # restore the original figure properties

/sw/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py in
print_figure(self, filename, dpi, facecolor, edgecolor, orientation,
**kwargs)
  1393         self.figure.draw(renderer)
  1394         renderer.finalize()
-> 1395         file.close()
  1396
  1397 class FigureManagerPdf(FigureManagerBase):

/sw/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py in
close(self)
   399         # objects
   400         self.endStream()
--> 401         self.writeFonts()
   402         self.writeObject(self.alphaStateObject,
   403                          dict([(val[0], val[1])

/sw/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py in
writeFonts(self)
   454                 fontdictObject = self._write_afm_font(filename)
   455             else:
--> 456                 fontdictObject = self.embedTTF(filename)
   457             fonts[Fx] = fontdictObject
   458             #print >>sys.stderr, filename

/sw/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py in
embedTTF(self, filename)
   506             width = font.load_char(unicode,
flags=LOAD_NO_SCALE).horiAdvance
   507             return cvt(width)
--> 508         widths = [ get_char_width(charcode) for charcode in
range(firstchar, lastchar+1) ]
   509
   510         widthsObject = self.reserveObject('font widths')

/sw/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py in
get_char_width(charcode)
   503         firstchar, lastchar = 0, 255
   504         def get_char_width(charcode):
--> 505             unicode = cp1252.decoding_map[charcode] or 0
   506             width = font.load_char(unicode,
flags=LOAD_NO_SCALE).horiAdvance
   507             return cvt(width)

<type 'exceptions.AttributeError'>: 'module' object has no attribute
'decoding_map'
[/traceback]

Any help would be great!

-Brian
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to