Hi,
annotate and usetex='True' can trigger a traceback if the text is
invalid. A space or an underscore generate this behavior, I haven't
tried others.
Ubuntu 8.10, mpl svn (rev. 7032).
Once again feel free to ignore this, I just feel compelled to report all
mpl bugs :)
JLS
Example:
#---------------------------------------------------------------------------
from matplotlib import rc
rc('text', usetex=True)
rc('font', family='serif')
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(-10.0,10.0,0.1)
plt.plot(x,np.sin(x))
ax = plt.gca()
ax.annotate(' ',xy=(-5.8,0.5),xytext=(-8.0,0.5),
arrowprops=dict(facecolor='black',width=1.5, shrink=0.05))
plt.show()
#---------------------------------------------------------------------------
Traceback:
Traceback (most recent call last):
File
"/usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
line 352, in expose_event
self._render_figure(self._pixmap, w, h)
File
"/usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtkagg.py",
line 75, in _render_figure
FigureCanvasAgg.draw(self)
File
"/usr/lib/python2.5/site-packages/matplotlib/backends/backend_agg.py",
line 283, in draw
self.figure.draw(self.renderer)
File "/usr/lib/python2.5/site-packages/matplotlib/figure.py", line
773, in draw
for a in self.axes: a.draw(renderer)
File "/usr/lib/python2.5/site-packages/matplotlib/axes.py", line
1672, in draw
a.draw(renderer)
File "/usr/lib/python2.5/site-packages/matplotlib/text.py", line
1615, in draw
self.update_positions(renderer)
File "/usr/lib/python2.5/site-packages/matplotlib/text.py", line
1542, in update_positions
l,b,w,h = self.get_window_extent(renderer).bounds
File "/usr/lib/python2.5/site-packages/matplotlib/text.py", line 662,
in get_window_extent
bbox, info = self._get_layout(self._renderer)
File "/usr/lib/python2.5/site-packages/matplotlib/text.py", line 253,
in _get_layout
clean_line, self._fontproperties, ismath=ismath)
File
"/usr/lib/python2.5/site-packages/matplotlib/backends/backend_agg.py",
line 152, in get_text_width_height_descent
renderer=self)
File "/usr/lib/python2.5/site-packages/matplotlib/texmanager.py",
line 594, in get_text_width_height_descent
dvi = dviread.Dvi(dvifile, 72*dpi_fraction)
File "/usr/lib/python2.5/site-packages/matplotlib/dviread.py", line
45, in __init__
self.file = open(filename, 'rb')
IOError: [Errno 2] No such file or directory:
'/home/jls/.matplotlib/tex.cache/557ff391b6beb8d5df7a86de0547f607.dvi'
------------------------------------------------------------------------------
_______________________________________________
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel