我有以下代码,用来将numpy数组绘制成直方图。但是我最终只得到一个框。
from sys import argv as a
import numpy as np
import matplotlib.pyplot as plt
r = list(map(int, (a[1], a[2], a[3], a[4], a[5])))
s = np.array([int((x - min(r))/(max(r) - min(r)) * 10) for x in r])
plt.hist(s, normed=True, bins=5)
plt.show()
程序使用以下输入运行 22 43 11 34 26
如何得到一个直方图,其中y轴代表列表元素的高度。