下面我有一个条形图的代码,我还想展示这些图的Pvalue有效值。有没有简单的方法来表示这些条形图的统计显著性
import matplotlib.pyplot as plt
X= [-0.9384815619939103, 1.0755888058123153, 0.061274066731665564, 0.65064830688728]
x_labels = ['A' ,'B', 'C', 'D']
error = [0.23722952107696088, 0.25505883348061764, 0.26038015798295744, 0.26073839861422]
pvalue = [0.000076, 0.000025, 0.813956, 0.012581]
fig, ax = plt.subplots()
ax.bar(x_labels, X, width=0.4, align='center', yerr=error)
plt.show()
它可以像shown here那样做,只需稍加修改
结果是
这是另一种解决方案,它将p值放入绘图图例中。在我看来,这比在条形图上绘制p值更令人愉快。在
相关问题 更多 >
编程相关推荐