I need to create lots of figures, then use savefig to save the figure.
But after about 280 pictures, it throws the exception RuntimeError: Could not allocate memory for image
Is there some function like clear() in Matplotlib ?
I need to create lots of figures, then use savefig to save the figure.
But after about 280 pictures, it throws the exception RuntimeError: Could not allocate memory for image
Is there some function like clear() in Matplotlib ?
Yes, you can use:
clf(): in order to clean the current figure close(): in order to close the current window