I have the following Dataset from which I want to obtain the line plot. The plot is correct but the labels are missing although I provide the label name in the code. Please provide me a method to include the labels. Also if I try to include xlabel and ylabel in the code it gives me an error AttributeError: 'Line2D' object has no property 'xlabel'
Dataframe res
UserId | date |-7|-6|-5|-4|-3|-2|-1|0 |1 |2 |3 |4 |5 |6 |7
1 2009-10-17 17:38:32.590 |0 |0 |0 |0 |0 |0 |1 |0 |1 |0 |0 |0 |0 |0 |0
2 2009-10-19 00:37:23.067 |0 |0 |0 |0 |0 |1 |1 |0 |1 |0 |0 |0 |0 |0 |0
3 2009-10-20 08:37:14.143 |0 |0 |0 |0 |0 |0 |1 |0 |0 |0 |0 |0 |0 |0 |0
4 2009-10-21 18:07:51.247 |0 |0 |0 |0 |0 |0 |1 |0 |0 |0 |0 |0 |0 |0 |0
5 2009-10-22 21:25:24.483 |0 |0 |0 |0 |0 |0 |1 |0 |0 |0 |0 |0 |0 |0 |0
Code
badges = ["A", "B", "C"]
for badge in badges:
res.iloc[:,2:].mean().plot(kind='line', label = badge)
Output
This is the output obtained from this code. I want the labels for all the three lines to be present in the graph. Along with that I want to add xlabel = "Week" and ylabel = "Mean Posts" on the axis.

