问题如下
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python27\lib\lib-tk\Tkinter.py", line 1542, in __call__
return self.func(*args)
File "C:\Users\11782\AppData\Roaming\Python\Python27\site-packages\matplotlib\backends\backend_tkagg.py", line 228, in resize
self.draw()
File "C:\Users\11782\AppData\Roaming\Python\Python27\site-packages\matplotlib\backends\backend_tkagg.py", line 300, in draw
tkagg.blit(self._tkphoto, self.renderer._renderer, colormode=2
File "C:\Users\11782\AppData\Roaming\Python\Python27\site-packages\matplotlib\backends\tkagg.py", line 34, in blit
dataptr, colormode, bboxptr)
TclError: error reading data, expected ptr height width
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python27\lib\lib-tk\Tkinter.py", line 1542, in __call__
return self.func(*args)
File "C:\Python27\lib\lib-tk\Tkinter.py", line 592, in callit
func(*args)
File "C:\Users\11782\AppData\Roaming\Python\Python27\site-packages\matplotlib\backends\backend_tkagg.py", line 320, in idle_draw
self.draw()
File "C:\Users\11782\AppData\Roaming\Python\Python27\site-packages\matplotlib\backends\backend_tkagg.py", line 300, in draw
tkagg.blit(self._tkphoto, self.renderer._renderer, colormode=2)
File "C:\Users\11782\AppData\Roaming\Python\Python27\site-packages\matplotlib\backends\tkagg.py", line 34, in blit
dataptr, colormode, bboxptr)
TclError: error reading data, expected ptr height width
解决办法:
删了matplotlib2.2.0rc
使用pip install matplotlib 重新安装即可