Apr-19-2020, 10:18 PM
Hello everyone,
hope someone can give me an advice.
I have 3 dataframes with different values, each with time (x-values) and y values.
I calculated the average and the standard deviation for the error bars with
hope someone can give me an advice.
I have 3 dataframes with different values, each with time (x-values) and y values.
I calculated the average and the standard deviation for the error bars with
mean = dataframe.groupby(['time','y values']).agg({'y values':'mean'}).reset_index() std = dataframe.groupby(['time','y values']).agg({'y values':'std'}).reset_index() mean['err'] = std['y values']Then I tried to plot everything with
fig, (ax1) = plt.subplots(1, 1) mean.plot(x='time', y='y values', style='.', color='b', legend=True, label='test', ax=ax1) ax1.errorbar(mean.index, mean['time'], yerr=mean['err']) ax1.legend(loc='lower right', fancybox=True, fontsize=9) ax1.yaxis.set_label_text("y values") ax1.xaxis.set_label_text("Time (h)") ax1.set_title("test")But the error bars are not shown in the right way. I tried it already with mean.plot(...yerr=' '), but the same result. Someone have an idea?