运行出现
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", line 1705, in __call__
return self.func(*args)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\matplotlib\backends\_backend_tk.py", line 267, in resize
self.draw()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 9, in draw
super(FigureCanvasTkAgg, self).draw()
...
FileNotFoundError: [Errno 2] No such file or directory: '../SIMLI.TTF'
原因:没找到字体文件的位置
源文件出错处:
font = mpl.font_manager.FontProperties(fname='../SIMLI.TTF', size=14)
字体文件名要从属性找,地址在上一层文件夹!不是本级