当前位置:   article > 正文

AttributeError: module ‘backend_interagg‘ has no attribute ‘FigureCanvas‘问题的解决办法

AttributeError: module ‘backend_interagg‘ has no attribute ‘FigureCanvas‘问题的解决办法

在pycharm中练习matplotlib绘制直方图时出现了问题,问题如下:

AttributeError: module 'backend_interagg' has no attribute 'FigureCanvas'

解决办法:

运行如下代码将agg改为TkAgg

matplotlib.use('TkAgg')

错误原因:matplotlib 的 backend 使用的是默认配置 agg (agg不能显示绘制的图),要想显示绘制的图需要更改 agg 为 TkAgg

参考链接:(5条消息) AttributeError: module ‘backend_interagg‘ has no attribute ‘FigureCanvas‘ 的解决办法_e5pool的博客-CSDN博客

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/371854
推荐阅读
相关标签
  

闽ICP备14008679号