seaborn 中相同 x 轴值的不同图
different plot for same x-axis value in seaborn
我有一个 pandas 数据框,它看起来像这样:
import seaborn as sns
import pandas as pd
d = {'a': [100, 125, 300, 520], 'b': [250, 270, 278, 248]}
df = pd.DataFrame(data=d, index=[25, 26, 26, 30])
a b
25 100 250
26 125 270
26 300 278
30 520 248
当我尝试使用
绘制此数据框时
df=sns.lineplot(data=df, dashes=False)
对 26 的值取平均值并显示误差条。但是我想单独绘制 26 的值。
这就是 estimator
参数的作用。请参阅文档:https://seaborn.pydata.org/generated/seaborn.lineplot.html
sns.lineplot(data=df, dashes=False, estimator=None)
我有一个 pandas 数据框,它看起来像这样:
import seaborn as sns
import pandas as pd
d = {'a': [100, 125, 300, 520], 'b': [250, 270, 278, 248]}
df = pd.DataFrame(data=d, index=[25, 26, 26, 30])
a b
25 100 250
26 125 270
26 300 278
30 520 248
当我尝试使用
绘制此数据框时df=sns.lineplot(data=df, dashes=False)
对 26 的值取平均值并显示误差条。但是我想单独绘制 26 的值。
这就是 estimator
参数的作用。请参阅文档:https://seaborn.pydata.org/generated/seaborn.lineplot.html
sns.lineplot(data=df, dashes=False, estimator=None)