how to plot timespace using matlab or seaborn and have different color coding based on values

60 Views Asked by At

I want to plot timespace with x-axis - timestamp , y-axis - id's and the line plotted , whose color would change base on the value of another field which is currState. I have the data in csv format and have used pandas to convert the data into dataframes. What I want is x-axis to have time at 1 minute interval, the color of the line should change based on currState(3 - green ,5- red, 6- yellow).

Sample data -

timestamp                                       currState          IntersectionId    
2020-02-26 16:12:13.131484                        3                    12345
2020-02-26 16:12:14.131484                        3                    12345
2020-02-26 16:12:15.131484                        3                    12345
2020-02-26 16:12:16.131484                        5                    12345
2020-02-26 16:12:17.131484                        5                    12345
2020-02-26 16:12:18.131484                        5                    12345
2020-02-26 16:12:19.131484                        6                    12345
2020-02-26 16:12:20.131484                        6                    12345
2020-02-26 16:12:21.131484                        6                    12345

the sample plot in the image

0

There are 0 best solutions below