Python 文件代码如下:
import matplotlib.pyplot as plt
fig = plt.figure()
plt.show()
执行后,能运行显示窗口:
但问题在于,一旦触控鼠标(MagicMouse)在 Figure 窗口(触控)滚动操作时,就会报错:
Traceback (most recent call last):
File "/Users/***/PycharmProjects/LNN/venv/pltTest.py", line 4, in
plt.show()
File "/Users/***/PycharmProjects/LNN/venv/lib/python3.6/site-packages/matplotlib/pyplot.py", line 253, in show
return _show(*args, **kw)
File "/Users/***/PycharmProjects/LNN/venv/lib/python3.6/site-packages/matplotlib/backend_bases.py", line 208, in show
cls.mainloop()
File "/Users/***/PycharmProjects/LNN/venv/lib/python3.6/site-packages/matplotlib/backends/_backend_tk.py", line 1073, in mainloop
Tk.mainloop()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tkinter/__init__.py", line 557, in mainloop
_default_root.tk.mainloop(n)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
难道 pyplot 不支持触控鼠标的手势操作?虽然操作可避免,这个报错无伤大雅,但还是想知道原因和解决办法啊,希望有大神能解答?