我想知道是否存在一種方法來繪製直方圖和在Python中使用matplotlib的漸變。如何繪製動畫?
我有繪製直方圖
a = np.array(values)
plt.hist(a, 32, normed=0, facecolor='blue', alpha = 0.25)
plt.show()
下,但我不知道是否matplotlib已得到繪製一個拱形體的好方法。
下面是我在做什麼:
a = np.array(values)
bins = np.arange(int(min), int(max) + 2)
histogram = np.histogram(a, bins = bins, normed = True)
v = []
s = 0.0
for e in histogram[0]:
s = s + e
v.append(s)
v[0] = histogram[0][0]
plt.plot(v)
plt.show()
偉大的答案!很有用! – FacundoGFlores
@FacundoGFlores - 謝謝! –