我需要创建很多图形,然后使用savefig
来保存图形。
但是大约280张图片后,抛出异常RuntimeError: Could not allocate memory for image
Matplotlib 中是否有类似clear()
的函数?
最佳答案
是的,您可以使用:
clf()
:为了clean the current figureclose()
:为了close the current window
关于python - 如何清除 Matplotlib for python 中的缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26967075/