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 '\\\\\\'?
err_kws
from seaborn.lineplot
matplotlib.axes.Axes.fill_between()
or matplotlib.axes.Axes.errorbar()
, depending on err_style
. '\\\\\\\\'
) based on {'/', '\\\\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
specified in the docs (note that \\
is an escape character and needs to be written twice).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.