簡體   English   中英

如何在 Seaborn Lineplot 函數中更改置信區間的填充圖案(剖面線)

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

我使用以下代碼使用 Seaborn 創建了一個簡單的線圖:

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

產生了這個:

在此處輸入圖片說明

我怎樣才能改變置信區間的模式,這樣我就會得到一個陰影模式,比如“\\\\\\”?

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