RuntimeError: maximum recursion depth exceeded
调用matplotlib画了一个带有sliderbar的统计图,每次拖动sliderbar就更新统计图,更新大概20次左右的时候就会出现下面的bug,哪位大神帮我看看,本人python小白
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python27\lib\lib-tk\Tkinter.py", line 1410, in __call__
return self.func(*args)
File "C:\Python27\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 380, in motion_notify_event
FigureCanvasBase.motion_notify_event(self, x, y, guiEvent=event)
File "C:\Python27\lib\site-packages\matplotlib\backend_bases.py", line 1720, in motion_notify_event
guiEvent=guiEvent)
File "C:\Python27\lib\site-packages\matplotlib\backend_bases.py", line 1343, in __init__
LocationEvent.__init__(self, name, canvas, x, y, guiEvent=guiEvent)
File "C:\Python27\lib\site-packages\matplotlib\backend_bases.py", line 1248, in __init__
axes_list = [a for a in self.canvas.figure.get_axes() if a.in_axes(self)]
File "C:\Python27\lib\site-packages\matplotlib\axes.py", line 1723, in in_axes
return self.patch.contains(mouseevent)[0]
File "C:\Python27\lib\site-packages\matplotlib\patches.py", line 589, in contains
(mouseevent.x, mouseevent.y))
File "C:\Python27\lib\site-packages\matplotlib\transforms.py", line 1297, in transform_point
return self.transform(np.asarray([point]))[0]
File "C:\Python27\lib\site-packages\matplotlib\transforms.py", line 1238, in transform
return self.transform_affine(self.transform_non_affine(values))
File "C:\Python27\lib\site-packages\matplotlib\transforms.py", line 2175, in transform_affine
return self.get_affine().transform(points)
File "C:\Python27\lib\site-packages\matplotlib\transforms.py", line 2203, in get_affine
self._a.get_affine().get_matrix()))
File "C:\Python27\lib\site-packages\matplotlib\transforms.py", line 1666, in __init__
Affine2DBase.__init__(self, **kwargs)
File "C:\Python27\lib\site-packages\matplotlib\transforms.py", line 1511, in __init__
Transform.__init__(self, *args, **kwargs)
File "C:\Python27\lib\site-packages\matplotlib\transforms.py", line 93, in __init__
self._parents = WeakValueDictionary()
File "C:\Python27\lib\weakref.py", line 53, in __init__
UserDict.UserDict.__init__(self, *args, **kw)
RuntimeError: maximum recursion depth exceeded
###### draw graph: add patch to the figure ######
def addBuyerPatch(self,Xs,Ys,isUpdate):
# set the left,right,top and bottom of the rectangles #
left = Xs
right = Xs + np.ones(len(left))
top = np.zeros(len(left))
bottom = top - Ys
# draw patch and add patch #
self.buyerXY = np.array([[left,left,right,right], [bottom,top,top,bottom]]).T
self.buyerBarpath = path.Path.make_compound_path_from_polys(self.buyerXY)
if(isUpdate==0):
self.buyerPatch = patches.PathPatch(self.buyerBarpath, facecolor='blue', edgecolor='gray', alpha=0.8)
self.ax.add_patch(self.buyerPatch)
self.haveBuyerPatch = 1
return -bottom.min()