I am trying to plot a diagram inside a loop and I expect to get two separate figures, but Python only shows one figure instead. In fact, it seems Python plots the second figure over the first one. This is the code I am using:
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(0,10)
y = np.arange(0,10)
for _ in range(2):
plt.plot(x,y)
plt.show()
It worth noting that I am working with Python 2.7 in PyCharm environment. Any kind of advice is appreciated.