Given a df of the form
df = pd.DataFrame(
{
"date": [datetime.datetime(2018, 1, x) for x in range(1, 8)],
"label": ["A", "A", "B", "B", "C", "A", "C"],
"value1": [1, 22, 3, 4, 5, 6, 7],
"value2": [10, 4, 30, 5, 6, 8, 9]
}
)
df.set_index('date', inplace=True)
I'd like to have a single plot that contains all the 6 lines: the value of value1 and value2 for each of the groups. I browsed other answers, but I couldn't find how to properly do it. The best I have is
fig, ax = plt.subplots()
for label, df in grouped:
df.plot(ax=ax, label="Value for {}".format(label))
plt.legend()
which produces this result:
There are two problems here (prob the same):
- I can't seem to control the label text
- the label it is useless as it it now, because it is not informative
Any ideas?

