MatplotlibDeprecationWarning: Support for FigureCanvases without a required_interactive_framework attribute was deprecated in Matplotlib 3.6 and will be removed two minor releases later. plt.xlabel(“x”)
MatplotlibDeprecationWarning: Support for FigureCanvases without a required_interactive_framework attribute was deprecated in Matplotlib 3.6 and will be removed two minor releases later. plt.show()
在绘图时出现错误,看网上有贴子说需要修改pycharm中搜索 Python Scientific 取消勾选 show plot tool window,但个人觉得比较麻烦,可以在绘图包导入时添加一行代码“plt.switch_backend(‘TkAgg’)”解决。
1. 添加的代码plt.switch_backend(‘TkAgg’)
#添加的代码
plt.switch_backend('TkAgg')
2. 取消勾选 show plot tool window的过程
第一种:
第二种: