seaborn or matplotlib line chart, line color depending on variable
问题 I have a pandas dataframe with three columns, Date (timestamp), Color ('red' or 'blue') and Value (int). I am currently getting a line chart from it with the following code: import matplotlib.pyplot as plt import pandas as pd Dates=['01/01/2014','02/01/2014','03/01/2014','04/01/2014','05/01/2014','06/01/2014','07/01/2014'] Values=[3,4,6,5,4,5,4] Colors=['red','red','blue','blue','blue','red','red'] df=pd.DataFrame({'Dates':Dates,'Values':Values,'Colors':Colors}) df['Dates']=pd.to_datetime(df[