pycharm中使用pyplot时报错MatplotlibDeprecationWarning
问题描述
在pycharm中使用Matplotlib中的pyplot时,运行代码报错:
MatplotlibDeprecationWarning: Support for FigureCanvases without a required_interactive_framework attribute was deprecated in Matplotlib 3.6 and will be removed two minor releases later.
问题解决
查询资料后,现在将解决方法进行记录。
第一步,点击pycharm菜单栏File——setting选项;
第二步,在setting窗口中选择Tools——Python Scientific,然后取消勾选show plots in tool window后,点击apply按钮,再点击ok按钮。
第三步,在代码结尾加上 plt.show()后,代码就可以正常执行且不报错(注:这里的plt是我引用的别名,import matplotlib.pyplot as plt)
总结
到此这篇关于pycharm中使用pyplot时报错MatplotlibDeprecationWarning的文章就介绍到这了,更多相关pyplot报错MatplotlibDeprecationWarning内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!
相关文章
Python使用Selenium模块模拟浏览器抓取斗鱼直播间信息示例
这篇文章主要介绍了Python使用Selenium模块模拟浏览器抓取斗鱼直播间信息,涉及Python基于Selenium模块的模拟浏览器登陆、解析、抓取信息,以及MongoDB数据库的连接、写入等相关操作技巧,需要的朋友可以参考下2018-07-07
最新评论