我使用谷歌进行搜索,但没有找到答案。
我的问题:
我有数据数组,我想使用百分比单位进行绘图。示例:
数据:[1, 3, 1, 3, 3, 2, 4, 5]
1:0.25
2:0.125
3:0.375
4:0.125
5:0.125
PS:我不想只使用 R python、matplotlib,如果需要 numpy
最佳答案
看一下matplotlib中的hist函数:http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.hist Numpy 还有直方图函数:http://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram.html
关于python - 使用百分比单位绘制数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5796146/