The problem occurs when having a set of X values and Y values (41 to be exact) and I want an error bar, this works, but it creates a lot of lines instead only one. Here is my code:
y_values = [
np.mean(image_data['some_parameter'][x])
for x in image_data['some_parameter']
]
yerr = [
statistics.stdev(image_data['some_parameter'][x])
for x in image_data['some_parameter']
]
x_values = list(image_data['some_parameter'].keys())
plt.errorbar(x_values, y_values, yerr=yerr, capsize=5, ecolor="red")
plt.show()
In the end, the result looks something like this: