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

Viewed 285

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:

enter image description here

How could I change the pattern of the Confidence Interval so I get a hatched pattern such as '\\\'?

1 Answers
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)

enter image description here

Related