python plot simple histogram given binned data

前端 未结 6 1386
生来不讨喜
生来不讨喜 2020-12-03 00:58

I have count data (a 100 of them), each correspond to a bin (0 to 99). I need to plot these data as histogram. However, histogram count those data and does not plot correctl

6条回答
  •  伪装坚强ぢ
    2020-12-03 01:46

    You can achieve this using matplotlib's hist as well, no need for numpy. You have essentially already created the bins as xbins. In this case x will be your weights.

    plt.hist(xbins,weights=x)
    

提交回复
热议问题