From: Clovis G. <cl...@pe...> - 2006-01-31 17:56:50
|
The example is (under Windows XP, Matplotlib 0.86.2, using Tkinter after making a "clean" matplotlib installation): from pylab import * rcParams['ps.useafm']=True a=arange(0,10) figure(1) plot(a,2*a) show() Until now everything is OK. When I press SaveFigure button in the NavigationToolbar the error messages are: Exception in Tkinter callback Traceback (most recent call last): File "D:\Python24\lib\lib-tk\Tkinter.py", line 1345, in __call__ return self.func(*args) File "D:\Python24\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 637, in save_figure self.canvas.print_figure(fname) File "D:\Python24\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 183, in print_figure agg.print_figure(filename, dpi, facecolor, edgecolor, orientation) File "D:\Python24\Lib\site-packages\matplotlib\backends\backend_agg.py", line 479, in print_figure ps.print_figure(filename, dpi, facecolor, edgecolor, orientation) File "D:\Python24\Lib\site-packages\matplotlib\backends\backend_ps.py", line 1048, in print_figure self.figure.draw(renderer) File "D:\Python24\Lib\site-packages\matplotlib\figure.py", line 524, in draw for a in self.axes: a.draw(renderer) File "D:\Python24\Lib\site-packages\matplotlib\axes.py", line 1438, in draw self.xaxis.draw(renderer) File "D:\Python24\Lib\site-packages\matplotlib\axis.py", line 562, in draw tick.draw(renderer) File "D:\Python24\Lib\site-packages\matplotlib\axis.py", line 161, in draw if self.label1On: self.label1.draw(renderer) File "D:\Python24\Lib\site-packages\matplotlib\text.py", line 858, in draw self._mytext.draw(renderer) File "D:\Python24\Lib\site-packages\matplotlib\text.py", line 338, in draw bbox, info = self._get_layout(renderer) File "D:\Python24\Lib\site-packages\matplotlib\text.py", line 181, in _get_layout tmp, heightt = renderer.get_text_width_height( File "D:\Python24\Lib\site-packages\matplotlib\backends\backend_ps.py", line 274, in get_text_width_height font = self._get_font_afm(prop) File "D:\Python24\Lib\site-packages\matplotlib\backends\backend_ps.py", line 298, in _get_font_afm font = AFM(file(fontManager.findfont(prop, fontext='afm'))) IOError: [Errno 2] No such file or directory: 'D:\\Python24\\share\\matplotlib\\phvr8a.afm' Obviously, there are no "*.afm" files in the "D:\python24\share\matplotlib\" directory. To be exact, there isn't even a "D:\python24\share\matplotlib\" directory! The same script runs fine when rcParams['ps.useafm']=False The same bug (?) seemed to exist in Matplotlib 0.86.1. Thanks for the support, Clovis Goldemberg |