If you need 8 different digits in 8 different windows, here is an example that will work:
import matplotlib.pyplot as plt import numpy as np x = np.linspace(0,10) y = np.sin(x) for i in range(8): plt.plot(x,y) plt.figure(i+1) plt.show()
This will display 8 different windows with x vs y and all windows will remain βaliveβ until you close them.
Make sure you call plt.show() outside the for loop
source share