AttributeError: module 'backend_interagg' has no attribute 'FigureCanvas'问题的解决方法

问题描述

使用python自带的绘图模块画图时,出现了这个错误:AttributeError: module 'backend_interagg' has no attribute 'FigureCanvas'

问题解决

在文件开头的地方加上这样两行代码:

import matplotlib
matplotlib.use('TkAgg')

这样就能够解决上面提到的问题啦~~~

效果展示一下:

posted @ 2024-03-23 20:05  yesyes1  阅读(562)  评论(0编辑  收藏  举报