![](/img/trans.png)
[英]How to make the confidence interval (error bands) show on seaborn lineplot
[英]How to change fill pattern (hatch) of the Confidence Interval in the Seaborn Lineplot function
err_kws
的seaborn.lineplot
matplotlib.axes.Axes.fill_between()
或matplotlib.axes.Axes.errorbar()
,具體取決於err_style
。'\\\\\\\\'
)基於{'/', '\\\\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
在文檔中指定(注意\\
是一個轉義字符,需要寫兩次)。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.