Seaborn中带有平均值和标准偏差值的标签组箱线图

时间:2019-10-12 21:42:26

标签: python label seaborn boxplot annotate

如何用均值和标准偏差值标记海洋分类箱图中的每个箱图?

enter image description here

我的代码是

import pandas as pd
import seaborn as sns
from os.path import expanduser as ospath

df = pd.read_excel(ospath('~/Documents/Python/Kandidatspeciale/TestData.xlsx'),'Ark1')

bp = sns.boxplot(y='throw angle', x='incident angle', 
                 data=df, 
                 palette="colorblind",
                 hue='Bat type')

bp.set_title('Rubber Comparison',fontsize=15,fontweight='bold', y=1.06)
bp.set_ylabel('Throw Angle [degrees]',fontsize=11.5)
bp.set_xlabel('Incident Angle [degrees]',fontsize=11.5)

我的数据框df在哪里

     Bat type  incident angle  throw angle
0      euro              15         28.2
1      euro              15         27.5
2      euro              15         26.2
3      euro              15         27.7
4      euro              15         26.4
5      euro              15         29.0
6      euro              30         12.5
7      euro              30         14.7
8      euro              30         10.2
9     china              15         29.9
10    china              15         31.1
11    china              15         24.9
12    china              15         27.5
13    china              15         31.2
14    china              15         24.4
15    china              30          9.7
16    china              30          9.1
17    china              30          9.5

0 个答案:

没有答案