現在Python 3.6.0を使用しています| Continuum Analytics、Inc. | (デフォルト、Dec 23 2016、11:57:41)をWindows(64ビット)にインストールします。後続のmatplotlibプロットのための新しいウィンドウを作成するには?
2つの異なるプロットを生成するために書いている手順が必要です。 1つのプロットには3つのグラフがあり、ヒストグラムを表示する別々のウィンドウが必要です。でもplt.figure()
を使用して
plt.subplot(311)
plt.plot(z)
plt.xlabel('Time(s)', fontsize=14)
plt.ylabel('Amplitude(v)', fontsize=8)
fig.subplots_adjust(hspace=.5)
plt.figure
plt.subplot(312)
plt.plot(timey[0:(len(freq))//2],y)
plt.xlabel('Frequency(Hz)', fontsize=14)
plt.ylabel('Amplitude(V)', fontsize=8)
plt.subplot(313)
plt.plot(fre, psd)
plt.xlabel('Frequency(Hz)', fontsize=14)
plt.ylabel('Power Spectrum Density(Watts/Hz)', fontsize =8)
plt.show()
np.savetxt(file ,y, delimiter=' ',newline=' ')
plt.savefig('FFT'+i+'.png', bbox_inches='tight')
wait = input("PRESS ENTER TO CONTINUE.") #an attempt at breakpoints
plt.figure
plt.subplot(111)
plt.plot(bin[0:bnn],his)
plt.show()
plt.savefig('Histogram'+i+'.png', bbox_inches='tight')
私はplt.subplot(111)
を使用しない限り、私はまだ元のプロットを消去し、同じウィンドウに新しいものを入れており、既存のプロットのオーバートッププロットします。私は2つの別々のウィンドウを生成したいと考えています。私は無用にいくつかの以前の質問を読んだ。私は%matplotlib qt
または私が何をインポートしたかを試してみましたmplとして、また使用しません。おそらく私はこれの構文を理解していないでしょうか?
'plt.figure()'(かっこ付き)を必ず呼び出してください。 – TomDLT