为什么在我的jupyter笔记本中,该线图中的线下方填充了seaborn / matplotlib?

时间:2018-11-29 05:39:44

标签: python pandas jupyter seaborn

我不知道为什么我的情节看起来像这样:

lineplot with unwanted fill below line

我只想显示没有填充的行。下面的代码。请注意,如果我在Spyder或cmd中运行,也会发生这种情况。

import matplotlib.pyplot as plt
import seaborn as sns
df_ard= pd.read_csv(pathx, parse_dates=['Date'] )


plt.figure(figsize=(15,8))

sns.lineplot(x="Date", y='As',
             hue="Location",
             data=df_ard,
             palette='bright')

1 个答案:

答案 0 :(得分:1)

这是一个有根据的猜测,因为您没有提供数据(请参见Minimal, Complete, and Verifiable example),但是我认为阴影来自于您为同一x值拥有多个y值这一事实。 / p>

如果您查看the documentation for sns.lineplot(),则会看到:

  

默认情况下,该图在每个值上的多个y值上聚合   x并显示对集中趋势的估计和置信度   该估算的时间间隔。

有几个选项可以删除阴影:

  • 如果您想继续汇总数据,但要删除阴影,请使用ci=None
  • 如果您不想汇总数据,请使用estimator=None