在python中绘制同一轴上的多个累积直方图时,我有一个美学问题。柱状图将以最后一个bin结束,而不是继续到终端轴。在
因此,当我绘制不同的总体图时,为了直观地显示一个KS统计数据,它最终看起来很平庸。
编辑:根据汤姆的建议,最小工作代码。在
import pylab as pl
import random as rnd
x1 = [rnd.gauss(0,7) for a in range(100)]
x2 = [rnd.gauss(-3,1) for a in range(100)]
x3 = [rnd.gauss(3,3) for a in range(100)]
pl.hist(x1, cumulative=True, histtype='stepfilled', alpha=0.25)
pl.hist(x2, cumulative=True, histtype='stepfilled', alpha=0.25)
pl.hist(x3, cumulative=True, histtype='stepfilled', alpha=0.25)
pl.show()
从美学角度看,图像的柱状图应该在轴的两端延续,如维基百科的图片所示:
目前没有回答
相关问题 更多 >
编程相关推荐