SEBASTIAN
SEBASTIAN

Reputation: 75

Multi-column lineplot using matplotlib or seaborn

a total inexpert here trying to learn.I want to make a multi-line graph using matplotlib or seaborn where the data is grouped as follows:

    X1 X2 X3
0   10 20 30
1   0  16 40
2   10 60 80
3   20 20 90

The idea is to plot the three points and have them connected by a line, being the x-axis equal to X1, X2, X3 (column labels) and the y-axis as the row values. I couldn't find any answer to this problem anywhere. Thank you very much in advance for the answers!

Upvotes: 0

Views: 45

Answers (1)

Quang Hoang
Quang Hoang

Reputation: 150825

Do you mean:

df.T.plot()

Output:

enter image description here

Upvotes: 1

Related Questions