Hello,
I am getting an error with savefig and pdf when I try to used matplotlib with latex font rendering (attached below). In etc/matplotlibrc, I set
text.latex.preamble : \usepackage{MinionPro}, \renewcommand{\sfdefault}{Myriad-LF}
It seems that the dviread backend does not find a specific *.vf, MinionPro-It–lcdfj.vf to be specific,
file that is not needed in my opinion. Any ideas how to solve that?
Thanks,
David
···
Traceback (most recent call last):
File “niotrode_tipz.py”, line 71, in
p.savefig(‘niotrode_impedance_plot.pdf’)
File “/usr/lib/python2.5/site-packages/matplotlib/pyplot.py”, line 342, in savefig
return fig.savefig(*args, **kwargs)
File “/usr/lib/python2.5/site-packages/matplotlib/figure.py”, line 964, in savefig
self.canvas.print_figure(*args, **kwargs)
File “/usr/lib/python2.5/site-packages/matplotlib/backends/backend_qt4agg.py”, line 147, in print_figure
FigureCanvasAgg.print_figure(self, *args, **kwargs)
File “/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py”, line 1310, in print_figure
**kwargs)
File “/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py”, line 1204, in print_pdf
return pdf.print_pdf(*args, **kwargs)
File “/usr/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py”, line 1864, in print_pdf
self.figure.draw(renderer)
File “/usr/lib/python2.5/site-packages/matplotlib/figure.py”, line 759, in draw
for a in self.axes: a.draw(renderer)
File “/usr/lib/python2.5/site-packages/matplotlib/axes.py”, line 1523, in draw
a.draw(renderer)
File “/usr/lib/python2.5/site-packages/matplotlib/axis.py”, line 733, in draw
self.label.draw(renderer)
File “/usr/lib/python2.5/site-packages/matplotlib/text.py”, line 299, in draw
bbox, info = self._get_layout(renderer)
File “/usr/lib/python2.5/site-packages/matplotlib/text.py”, line 199, in _get_layout
line, self._fontproperties, ismath=self.is_math_text(line))
File “/usr/lib/python2.5/site-packages/matplotlib/backends/backend_pdf.py”, line 1560, in get_text_width_height_descent
page = iter(dvi).next()
File “/usr/lib/python2.5/site-packages/matplotlib/dviread.py”, line 62, in iter
have_page = self._read()
File “/usr/lib/python2.5/site-packages/matplotlib/dviread.py”, line 119, in _read
self._dispatch(byte)
File “/usr/lib/python2.5/site-packages/matplotlib/dviread.py”, line 207, in _dispatch
self._fnt_def(k, c, s, d, a, l, n)
File “/usr/lib/python2.5/site-packages/matplotlib/dviread.py”, line 368, in _fnt_def
vf = _vffile(n[-l:])
File “/usr/lib/python2.5/site-packages/matplotlib/dviread.py”, line 779, in _vffile
return _fontfile(texname, Vf, ‘.vf’, _vfcache)
File “/usr/lib/python2.5/site-packages/matplotlib/dviread.py”, line 768, in fontfile
result = class(filename)
File “/usr/lib/python2.5/site-packages/matplotlib/dviread.py”, line 437, in init
self._read()
File “/usr/lib/python2.5/site-packages/matplotlib/dviread.py”, line 119, in _read
self._dispatch(byte)
File “/usr/lib/python2.5/site-packages/matplotlib/dviread.py”, line 466, in _dispatch
Dvi._dispatch(self, byte)
File “/usr/lib/python2.5/site-packages/matplotlib/dviread.py”, line 207, in _dispatch
self._fnt_def(k, c, s, d, a, l, n)
File “/usr/lib/python2.5/site-packages/matplotlib/dviread.py”, line 504, in _fnt_def
Dvi._fnt_def(self, k, *args)
File “/usr/lib/python2.5/site-packages/matplotlib/dviread.py”, line 368, in _fnt_def
vf = _vffile(n[-l:])
File “/usr/lib/python2.5/site-packages/matplotlib/dviread.py”, line 779, in _vffile
return _fontfile(texname, Vf, '.vf', _vfcache)
File “/usr/lib/python2.5/site-packages/matplotlib/dviread.py”, line 768, in fontfile
result = class(filename)
File “/usr/lib/python2.5/site-packages/matplotlib/dviread.py”, line 437, in init
self._read()
File “/usr/lib/python2.5/site-packages/matplotlib/dviread.py”, line 119, in _read
self._dispatch(byte)
File “/usr/lib/python2.5/site-packages/matplotlib/dviread.py”, line 466, in _dispatch
Dvi._dispatch(self, byte)
File “/usr/lib/python2.5/site-packages/matplotlib/dviread.py”, line 207, in _dispatch
self._fnt_def(k, c, s, d, a, l, n)
File “/usr/lib/python2.5/site-packages/matplotlib/dviread.py”, line 504, in _fnt_def
Dvi._fnt_def(self, k, *args)
File “/usr/lib/python2.5/site-packages/matplotlib/dviread.py”, line 370, in _fnt_def
self.fonts[k] = DviFont(scale=s, tfm=tfm, texname=n, vf=vf)
File “/usr/lib/python2.5/site-packages/matplotlib/dviread.py”, line 398, in init
for char in range(0, max(tfm.width)) ]
ValueError: max() arg is an empty sequence