简体   繁体   English

如何在 Seaborn Lineplot 函数中更改置信区间的填充图案(剖面线)

[英]How to change fill pattern (hatch) of the Confidence Interval in the Seaborn Lineplot function

I have created a simple lineplot with Seaborn using this code:我使用以下代码使用 Seaborn 创建了一个简单的线图:

sns.lineplot(data=data, x='year', y='Value', color='#128094', linewidth=1, estimator=lambda x: x.sum() / 12)

Which produced this:产生了这个:

在此处输入图片说明

How could I change the pattern of the Confidence Interval so I get a hatched pattern such as '\\\\\\'?我怎样才能改变置信区间的模式,这样我就会得到一个阴影模式,比如“\\\\\\”?

import seaborn as sns
import matplotlib.pyplot as plt

flights = sns.load_dataset("flights")

fig, ax = plt.subplots(figsize=(10, 6))
p = sns.lineplot(data=flights, x="year", y="passengers", err_kws={'linestyle': '--', 'hatch': '///', 'fc': 'none'}, ax=ax)

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM