I think something broke with the recent changes to legend. For example, in
ipython -pylab:
plot([1,2,3,4],label='test')
legend(loc=(.1, .5))
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (185, 0))
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (46, 0))
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
/home/darren/<ipython console> in <module>()
/usr/lib64/python2.6/site-packages/matplotlib/pyplot.pyc in legend(*args,
**kwargs)
2441
2442 ret = gca().legend(*args,
**kwargs)
-> 2443
draw_if_interactive()
2444 return
ret
2445 if Axes.legend.__doc__ is not
None:
/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_qt4.pyc in
draw_if_interactive()
38 figManager =
Gcf.get_active()
39 if figManager !=
None:
---> 40
figManager.canvas.draw()
41
42 def
_create_qApp():
/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_qt4agg.pyc in
draw(self)
131 if DEBUG: print "FigureCanvasQtAgg.draw",
self
132 self.replot =
True
--> 133
FigureCanvasAgg.draw(self)
134
self.update()
135 # Added following line to improve realtime pan/zoom on
windows:
/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_agg.pyc in
draw(self)
281
282 self.renderer =
self.get_renderer()
--> 283
self.figure.draw(self.renderer)
284
285 def
get_renderer(self):
/usr/lib64/python2.6/site-packages/matplotlib/figure.pyc in draw(self,
renderer)
770
771 # render the
axes
--> 772 for a in self.axes: a.draw(renderer)
773
774 # render the figure text
/usr/lib64/python2.6/site-packages/matplotlib/axes.pyc in draw(self,
renderer,
inframe)
1599
1600 for zorder, i, a in
dsu:
-> 1601
a.draw(renderer)
1602
1603
renderer.close_group('axes')
/usr/lib64/python2.6/site-packages/matplotlib/legend.pyc in draw(self,
renderer)
317 if
self._drawFrame:
318 # update the location and size of the
legend
--> 319 bbox = self._legend_box.get_window_extent(renderer)
320 self.legendPatch.set_bounds(bbox.x0, bbox.y0,
321 bbox.width, bbox.height)
/usr/lib64/python2.6/site-packages/matplotlib/offsetbox.pyc in
get_window_extent(self, renderer)
196 '''
197 w, h, xd, yd, offsets = self.get_extent_offsets(renderer)
--> 198 px, py = self.get_offset(w, h, xd, yd)
199 return mtransforms.Bbox.from_bounds(px-xd, py-yd, w, h)
200
/usr/lib64/python2.6/site-packages/matplotlib/offsetbox.pyc in
get_offset(self,width, height, xdescent, ydescent)
155 """
156 if callable(self._offset):
--> 157 return self._offset(width, height, xdescent, ydescent)
158 else:
159 return self._offset
/usr/lib64/python2.6/site-packages/matplotlib/legend.pyc in
_findoffset_loc(self, width, height, xdescent, ydescent)
292 "Heper function to locate the legend"
293 bbox = Bbox.from_bounds(0, 0, width, height)
--> 294 x, y = self._get_anchored_bbox(self._loc, bbox,
self.parent.bbox)
295 return x+xdescent, y+ydescent
296
/usr/lib64/python2.6/site-packages/matplotlib/legend.pyc in
_get_anchored_bbox(self, loc, bbox, parentbbox)
623 display coordinates.
624 """
--> 625 assert loc in range(1,11) # called only internally
626
627 BEST, UR, UL, LL, LR, R, CL, CR, LC, UC, C = range(11)
AssertionError: