【Python小白学习——错误解决3】RuntimeWarning: More than 20 figures have been opened

待解决的问题:

RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).

解决方法:

plt.close()

主要是由于画图时候创建了太多figure,会拖累运行速度。

你可能感兴趣的:(Python笔记,python)