我正在尝试使用matplotlib.errobar函数绘制误差线,只显示下限误差。如果我使用"uplims=True",我会得到下限误差,但现在有一个箭头作为误差上限。如何将该上限改回水平线?
import numpy as np
import matplotlib.pyplot as plt
fig = plt.figure()
x = np.arange(10)
y = 2.5 *x
yerr = np.linspace(0.05, 2, 10)
fig1,ax1=plt.subplots()
#Here error capstyle is a horizontal line
plt.errorbar(x, y + 6, yerr=yerr,capsize=4, label='both limits (default)')
#Error capstyle suddenly changes to arrow
plt.errorbar(x, y + 2, yerr=yerr, uplims=True, label='uplims=True')
plt.show()