作为我正在做的一个项目的一部分,我需要在循环中将数据添加到直方图中。项目的一部分要求是我不使用数组来存储数据。下面是我要做的事情的psedo代码:
import matplotlib.pyplot as plt #could by numpy if that works better
plt.hist(define histogram with n bins)
for i in range (bignumber):
MCMC to find datapoint
add point to histogram
plt.plot()
我遇到的问题是如何在一个没有数据的柱状图前面加上前缀,然后在生成的时候将数据追加到它上面。在
作为一个自我宣传(免责声明!)。。。对于可更新的直方图,您可以使用我的名为physt:https://github.com/janpipek/physt的库。收集完所有数据后,可以使用类似于matplotlib的方式绘制结果(实际上,在后面使用matplotlib)。在
相关问题 更多 >
编程相关推荐