I am using groupby() and for plotting each group. I have a dataframe:
which each group have the same 'normal' value
id date value normal
1 5.2 20 200
1 5.4 100 200
1 6.9 30 200
2 2.4 20 500
2 3.4 100 500
I want to plot each group date and value columns (for x,y axes) and add axhline with the normal values correspond to the group. I've tried:
ax = sns.scatterplot("date", "value", data = data)
grouped = data.groupby('id')
normal_val= grouped['normal']
plt.axhline(normal_val,c='red', ls=':') #===> THIS LINE
plt.show()
but does not work. Hope someone could help! thanks

