【发布时间】:2018-02-08 22:33:54
【问题描述】:
是否可以动态控制误差线上限的大小?就像控制箱线图中的胡须帽一样?因此,无需将倾覆设置为某个固定值。从下面的例子中应该会看到更多。
fig = plt.figure()
gs = gridspec.GridSpec(2, 2)
ax0 = fig.add_subplot(gs[0])
ax1 = fig.add_subplot(gs[1])
ax2 = fig.add_subplot(gs[2])
ax3 = fig.add_subplot(gs[3])
n = 3
ax0.bar(list(range(n)),
np.random.randint(1,20,n),
yerr=np.random.randn(n),
edgecolor="red",
fill=False,
capsize=5)
ax1.boxplot(np.random.normal(70, 25, (200,n)))
n = 12
ax2.bar(list(range(n)),
np.random.randint(1,20,n),
yerr=np.random.randn(n),
edgecolor="red",
fill=False,
capsize= 5)
ax3.boxplot(np.random.normal(70, 25, (200,n)))
更多的话:
是否有可能以某种方式控制相对于垃圾箱之间的间距的倾覆。如果垃圾箱在所有整数上,我希望倾覆的宽度为bin_center +/- 0.25
【问题讨论】:
-
恐怕不太清楚你想做什么。您能否再用几句话来解释您展示的图片有什么问题以及您希望它们看起来有何不同?
-
希望更新澄清了这个问题。
-
所做的编辑更加模糊。 0.25 不是一个相对数字。
标签: python-3.x matplotlib