Как нарисовать граф средств с Python? - PullRequest
0 голосов
/ 21 июня 2020

enter image description here

I need to draw a graph like above.

The number represents mean and the stick represents the 95% interval.

I can only do this with boxplot. How would i do this with sticks like the graph above instead of boxes.

plt.figure(figsize=(12, 8))
sns.set_style("whitegrid") 
plt.ylim(0,130) 

ax = sns.boxplot(x='ING_PERCENTAGE', y='WTP_PREM%', showfliers=False, 
linewidth=0.8, showmeans=False, data=df)
ax = sns.pointplot(x='ING_PERCENTAGE', y='WTP_PREM%', data=df, ci=None, 
color='black')

введите описание изображения здесь

1 Ответ

0 голосов
/ 21 июня 2020

есть seaborn.pointplot , доверительный интервал задается в параметре ci. чтобы убедиться, что у вас есть заглавные буквы в полосе на интервале, убедитесь, что вы также установили опрокидывание (в примере по ссылке 0,2)

...