matplotlib.pyplot не забуде попередні графіки - як я можу змити / оновити?
Як ви можете matplotlib.pyplot"забути" попередні сюжети Я намагаюся побудувати графік кілька разів, використовуючи matplotlib.pyplot Код виглядає так: def plottest(): import numpy as np import matplotlib.pyplot as plt a=np.random.rand(10,) b=np.random.rand(10,) c=np.random.rand(10,) plt.plot(a,label='a') plt.plot(b,label='b') plt.plot(c,label='c') plt.legend(loc='upper left') plt.ylabel('mag') plt.xlabel('element)') plt.show() e=np.random.rand(10,) f=np.random.rand(10,) g=np.random.rand(10,) plt.plot(e,label='e') plt.plot(f,label='f') plt.plot(g,label='g') plt.legend(loc='upper left') plt.ylabel('mag') plt.xlabel('element)') plt.show() На …