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.
这是因为循环太多,每个循环里面画了一张图,所以可以在每个循环内把plt关闭。

plt.close()

猜你喜欢

转载自blog.csdn.net/weixin_43843657/article/details/88716369