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()
残念ながら、私は同じプロットを得続けます私が何をしていても(実際に実行して完了した他のコードから)
同様のコードは以前私のために働いていました。
私はこれらの質問を見てきました:
Matplotlib pyplot show() doesn't work once closed
(python) matplotlib pyplot show() .. blocking or not?
と無駄にplt.show()
、plt.clf()
とplt.close
を使用してみました。
アイデア?