你好,我正在绘制一个函数的图像,并打印出各个值。
我还想将这10个情况分别绘制在不同的窗口中。
所以我创建了一个新的for循环来进行绘图,但它只绘制了第一个实例,只有在关闭第一个窗口后,我才能看到第二个窗口。
我还尝试使用plt.hold(true)。
以下是我尝试的内容-
有没有办法我可以同时在10个不同的窗口中生成10个图表?
所以我创建了一个新的for循环来进行绘图,但它只绘制了第一个实例,只有在关闭第一个窗口后,我才能看到第二个窗口。
我还尝试使用plt.hold(true)。
以下是我尝试的内容-
def signal():
t1 = np.random.choice(candidates)
t2 = np.random.choice(candidates)
t3 = np.random.choice(candidates)
t4 = np.random.choice(candidates)
t5 = np.random.choice(candidates)
y = a * np.exp(-t /t1) + a * np.exp(-t /t2) + a * np.exp(-t /t3) + a * np.exp(-t /t4) + a * np.exp(-t /t5)
return y
for i in range(nsets):
signalset = []
signalset.append(signal())
print(signal())
for i in range (nsets):
plt.plot(t, signal())
plt.show()
plt.hold(True)
有没有办法我可以同时在10个不同的窗口中生成10个图表?