在pycharm中使用Matplotlib中的pyplot时,运行代码报错:
标签:plt,MatplotlibDeprecationWarning,pyplot,点击,报错,pycharm From: https://www.cnblogs.com/gzhblog/p/18067170MatplotlibDeprecationWarning: 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)