尧图网站设计 尧图网站设计YAOTU DESIGN
ARTICLE DETAIL

资讯详情

深耕网站设计与一线实操的经验洞察。

解决matplotlib报错: AttributeError: ‘FigureCanvasInterAgg‘ object has no attribute ‘tostring_rgb‘. Did y

解决matplotlib报错: AttributeError: ‘FigureCanvasInterAgg‘ object has no attribute ‘tostring_rgb‘. Did y 解决matplotlib报错 AttributeError: ‘FigureCanvasInterAgg’ object has no attribute ‘tostring_rgb’. Did you mean: ‘tostring_argb’?报错原因PyCharm 自带的 pycharm_matplotlib_backend 与新版本 matplotlib 不兼容新版 matplotlib 移除了 tostring_rgb仅保留 tostring_argbPyCharm 的内置绘图后端插件还在调用旧接口触发属性缺失异常import matplotlib# 切换后端可选 agg / TkAgg / Qt5Aggmatplotlib.use(Agg)importmatplotlib.pyplotasplt最顶部添加切换 matplotlib 后端不使用 PyCharm 自带 InterAgg 后端添加之后就可以显示出图像来了
返回列表