Pandas 如何使用seaborn显示多个timeseries绘图

Pandas 如何使用seaborn显示多个timeseries绘图,pandas,dataframe,seaborn,Pandas,Dataframe,Seaborn,我尝试使用Seaborn从数据帧生成4个绘图 Date A B C D 2019-04-05 330.665 161.975 168.69 0 2019-04-06 322.782 150.243 172.539 0 2019-04-07 322.782 150.243 172.539 0 2019-04-08 295.918 127.801 168.117 0 2019-04-09 282.674 126.894 155.78 0

我尝试使用Seaborn从数据帧生成4个绘图

Date        A       B       C       D
2019-04-05  330.665 161.975 168.69  0
2019-04-06  322.782 150.243 172.539 0
2019-04-07  322.782 150.243 172.539 0
2019-04-08  295.918 127.801 168.117 0
2019-04-09  282.674 126.894 155.78  0
2019-04-10  293.818 133.413 160.405 0
我已经用pd.to_DateTime铸造了日期,用pd.to_数字铸造了数字。以下是df.info:

<class 'pandas.core.frame.DataFrame'>
Int64Index: 6 entries, 460 to 465
Data columns (total 5 columns):
Date  6 non-null datetime64[ns]
A     6 non-null float64
B     6 non-null float64
C     6 non-null float64
D     6 non-null float64
dtypes: datetime64[ns](1), float64(4)
memory usage: 288.0 bytes
然后尝试了lmplot

sns.lmplot(x = df['Date'], y='Unit', col='Var', data=df)
然而,我得到了回溯:

TypeError: Invalid comparison between dtype=datetime64[ns] and str
我也尝试过设置df.set_index['Date'],并使用x=df.index重新填充,这给了我同样的错误

数据可以用谷歌表格打印,但我正在尝试自动化一个工作流程,在这个工作流程中,图表可以生成并通过Slack发送给选定的收件人


我希望我已经清楚地表达了我自己,因为我是Python和Seaborn的新手,希望从这里的专家那里得到一些帮助。

关于您可以使用的图例。legendloc=左上角,bbox_to_anchor=1,1,如本例所示

%matplotlib inline
import pandas as pd
import numpy as np


data = np.random.rand(10,4)
df = pd.DataFrame(data, columns=["A", "B", "C", "D"])
df.plot()\
  .legend(loc="upper left", bbox_to_anchor=(1,1));
而对于第二个IIUC,您可以从

df.plot(subplots=True, layout=(2,2));
你考虑过使用吗?
df.plot(subplots=True, layout=(2,2));