在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.

image

解决方法

File -> Settings -> Tools -> Python Scientific
Python MatplotlibDeprecationWarning Matplotlib 3.6 and will be removed two minor releases later-小白菜博客
代码后面加上 plt.show()
image