其實(shí)這只是一個警告,忽略也可。
一、控制臺輸出
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的支持已被棄用,并將在兩個次要版本后刪除。
二、問題分析
當(dāng)遇到這個警告信息時,它意味著你正在使用Matplotlib庫的一個版本,該庫已經(jīng)棄用了某些功能或行為,并計劃在將來的版本中刪除這些功能。
這個具體的警告消息是指在Matplotlib版本3.6中引入了一項(xiàng)更改,影響了FigureCanvases對象。文章來源:http://www.zghlxwxcb.cn/news/detail-704128.html
三、問題解決方案
在PyCharm的Settings
中取消勾選Tools—Python Scientific—Show plots in tool window
文章來源地址http://www.zghlxwxcb.cn/news/detail-704128.html
附:在Python腳本或交互式環(huán)境中查看當(dāng)前安裝的Matplotlib版本
import matplotlib
print(matplotlib.__version__)
到了這里,關(guān)于PyCharm中使用matplotlib.pyplot.show()報錯MatplotlibDeprecationWarning的解決方案的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!