问题描述
只是一个简单的问题,在
但是我希望误差条带有一条简单的水平线,而不是两端的箭头.但是 plt.errorbar()
函数
删除 uplims = True
和 lolims = True
;默认情况下绘制两个限制,没有任何结束箭头:
将matplotlib.pyplot导入为pltplt.errorbar(1,0.25,yerr = 0.1,fmt ='o')plt.show()
编辑:
增加 capsize 可以在误差线的末尾添加大写字母,并增加 capthick 可以使大写字母更厚:
plt.errorbar(1,0.25,yerr = 0.1,fmt ='o',capsize = 3)
plt.errorbar(1,0.25,yerr = 0.1,fmt ='o',capsize = 3,capthick = 3)
just a quick question, where I couldn't find anything helpful in the plt.errorbar
documentation
I want to plot values with error bars:
import matplotlib.pyplot as plt
plt.errorbar(1, 0.25, yerr=0.1, uplims=True, lolims=True, fmt='o')
plt.show()
But I would like to have error bars with a simple horizontal line instead of arrows at the ends. But there is no "capmarker" or similar option in the plt.errorbar()
function
Remove the uplims=True
and lolims=True
; both limits are plotted by default, without any ending arrows:
import matplotlib.pyplot as plt
plt.errorbar(1, 0.25, yerr=0.1, fmt='o')
plt.show()
EDIT:
Increase the capsize to add caps to the end of the error bars, and increase the capthick to make the caps thicker:
plt.errorbar(1, 0.25, yerr=0.1, fmt='o', capsize=3)
plt.errorbar(1, 0.25, yerr=0.1, fmt='o', capsize=3, capthick=3)
这篇关于如何在matplotlib中更改误差线限制的标记符号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!