RuntimeWarning: More than 20 figures have been opened.

绘图时出现以下警告:

60: 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. 

解决方法:

在循环里面加入以下代码:

plt.close()

RuntimeWarning: More than 20 figures have been opened._第1张图片

 

你可能感兴趣的:(matplotlib,python,开发语言)