I have a question for errorbars with a pyplot.barh.
I want to include errorbars at the left side of the interval, not only on the right side( in the picture, the right side has errorbars, i want the same ones(same xerr) on the left side…
The code i used is following
plt.figure()
p = "Blue Colours Difference"
p1 = "Blue"
plt.title(f"{p}")
setdpi = 300
subList = [element for element in light_list if p1 in element.name]
for x in subList:
print(x.name, x.LB, x.RB)
x = np.array([str(x.name) for x in subList])
LB = np.array([x.LB for x in subList])
RB = np.array([x.RB for x in subList])
colour = np.array([x.colour for x in subList])
plt.barh(x, RB-LB, color = colour, left = LB, xerr = 1, capsize = 2)
plt.xlabel("Wavelength "+ (r'$lambda$')+ " [nm]")
plt.ylabel("Types of light")
plt.xlim(min(LB)-5,max(RB)+5)
plt.grid(True, axis = "x")
plt.savefig(f'pictures/{p}_diffraction_graph.png', dpi=setdpi)
plt.show()
I looked it up in the documentation and tried finding online resources regarding that problem