2016-10-16 1 views
1

平均値(または他の中央傾向値)と変動値(標準偏差または信頼区間)を表すポイントを、シーボーンのFacetGrid?海面のFacetGridディストリビューションに平均値と変動性を追加

結果は、図のhereと似ていますが、各FacetGridサブプロットに平均/ SDが表示されます。 Thisは、非FacetGridの場合に関連する質問です。 @ mwaskomさんのコメントに基づいて

+0

おそらく役に立ちます:https://seaborn.github.io/tutorial/axis_grids.html#mapping-custom-functions-onto-the-grid – mwaskom

答えて

0

は、ここに一つの可能​​な解決策は、(pointplotのための類似した箱ひげ図を使用して)です:

tips = sns.load_dataset("tips") 

sns.set(font_scale=1.3) 

def dist_boxplot(x, **kwargs): 
    ax = sns.distplot(x, hist_kws=dict(alpha=0.2)) 
    ax2 = ax.twinx() 
    sns.boxplot(x=x, ax=ax2) 
    ax2.set(ylim=(-5, 5)) 

g = sns.FacetGrid(tips, col="sex") 
g.map(dist_boxplot, "total_bill"); 

"distplot plus boxplot"

(わからない理由0.01が少し右にシフトしています...)