我已经计算了区间边界
import numpy as np
boundaries = np.array([-1.0, -0.5, 0.0, 0.5, 1.0])
和归一化频率
normalized_frequencies = np.array([0.10, 0.40, 0.40, 0.10])
My question: How can I plot a histogram with the bar boundaries like
boundaries
and the y-values asnormalized_frequencies
?
我想你需要的是条形图而不是柱状图。这里的要点是只使用前四个边界值,然后将宽度等于边界之间的间距。在这种情况下,宽度为0.5。黑色
edgecolor
是用来区分条形图的。你知道吗第二种选择是找到每个间隔的中心点
相关问题 更多 >
编程相关推荐