When creating plots in Pycharm, sometimes new plots from different executions of the same file overwrite the old ones. It does not happen always. Sometimes new plots will be made other times not.
How to make it so that each plot is always a new plot and never overwrites old plots?
Simple example:
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-5, 5, 100)
plt.plot(x, np.sin(x))
plt.show()
I ran this 15 times, and only 7 different plots were drawn. Others were overwritten.
What I would have wanted is to have 15 different plots.
Do I need to add some extra code to make sure each plot is different? Is there some setting in PyCharm to change this behaviour?