I have a table like below:
date category num
xxx a 10
xxx b 23
xxx c 11
..........
Basically I want to draw a line chart that: 1. x axis is the time series, 2. y is the num, and 3. each category gets their own line, so in the above case there should be 3 lines.
>Solution :
you can seaborn package. Use seaborn lineplot .
sns.lineplot(x=’date’,y=’num, data=df, hue=’category’,palette=’bright)
Using hue should give you 3 separate graph.
You can also use matplotlib to look at it’s basic documentation.
Here is the documentation for that.
https://seaborn.pydata.org/generated/seaborn.lineplot.html