Python Seaborn jointplot在图表上未显示相关系数和p值 [英] Python Seaborn jointplot does not show the correlation coefficient and p-value on the chart

查看:36
本文介绍了Python Seaborn jointplot在图表上未显示相关系数和p值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用下面的图绘制联合图,从样本中我看到它应该在图表上显示相关系数和p值.但是它没有在我的上显示这些值.有什么建议吗?谢谢.

I'm trying to plot jointplot with below and from samples I saw it should show the correlation coefficient and p-value on the chart. However it does not show those values on mine. Any advice? thanks.

import seaborn as sns
sns.set(style="darkgrid", color_codes=True)
sns.jointplot('Num of A', ' Ratio B', data = data_df, kind='reg', height=8)
plt.show()

推荐答案

我最终使用下面的绘图

I ended up using below to plot

import seaborn as sns
import scipy.stats as stats

sns.set(style="darkgrid", color_codes=True)
j = sns.jointplot('Num of A', ' Ratio B', data = data_df, kind='reg', height=8)
j.annotate(stats.pearsonr)
plt.show()

这篇关于Python Seaborn jointplot在图表上未显示相关系数和p值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆