2つのデータリストデータ値(それぞれ100個の数値)がありますd1 = [0.5,0.6,0.45、.......]、d2 = 0.45,0.65、........]。次の図のように2つのリストデータを使って2つのhistをプロットしたい! matplotlibでプロットする方法、ありがとう!python3:matplotlibで2つのリストデータでヒストグラムをプロットする方法
def plot_data(d1, d2):
fig, ax = plt.subplots()
ax.hist(d1, 100, 50, ec='red', fc='none', lw=1.5, histtype='step', label='n-gram')
ax.hist(d2, 100, 50, ec='green', fc='none', lw=1.5, histtype='step', label='ensemble')
ax.legend(loc='upper left')
plt.show()
をが、エラーがあります: 私のコードは次のとおりです
mn, mx = [mi + 0.0 for mi in range]
TypeError: 'int' object is not utterable
参照してください。 – harshil9968
@ harshil9968が言っていることは、エラーがそのようなデータをプロットすることと何らかの関係があることを示しているという証拠はないということです。 – Gormador