其实这只是一个警告,忽略也可。
一、控制台输出
MatplotlibDeprecationWarning: Support for FigureCanvases without a required_interactive_framework attribute was deprecated in Matplotlib 3.6 and will be removed two minor releases later.
MatplotlibDeprecationWarning:在Matplotlib 3.6中,对不带required_interactive_framework属性的FigureCanvas的支持已被弃用,并将在两个次要版本后删除。
二、问题分析
当遇到这个警告信息时,它意味着你正在使用Matplotlib库的一个版本,该库已经弃用了某些功能或行为,并计划在将来的版本中删除这些功能。
这个具体的警告消息是指在Matplotlib版本3.6中引入了一项更改,影响了FigureCanvases对象。文章来源:https://www.toymoban.com/news/detail-704128.html
三、问题解决方案
在PyCharm的Settings
中取消勾选Tools—Python Scientific—Show plots in tool window
文章来源地址https://www.toymoban.com/news/detail-704128.html
附:在Python脚本或交互式环境中查看当前安装的Matplotlib版本
import matplotlib
print(matplotlib.__version__)
到了这里,关于PyCharm中使用matplotlib.pyplot.show()报错MatplotlibDeprecationWarning的解决方案的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!