简体   繁体   中英

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:

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)

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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