python - Python Seaborn 联合图未在图表上显示相关系数和 p 值
问题描述
我正在尝试用下面和从样本中绘制联合图,我看到它应该在图表上显示相关系数和 p 值。但是,它没有显示我的这些值。有什么建议吗?谢谢。
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()
解决方案
我最终使用下面来绘制
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()
推荐阅读
- java - 为什么使用 TCP 使用一个不能总是精确的基本计时器,而 Java 中的计时器总是精确的?
- spring-boot - 如何使用 EmbeddedKafkaRule/EmbeddedKafka 设置 Spring Kafka 测试以修复 TopicExistsException 间歇性错误?
- svelte - Sapper 默认模板的汇总配置
- scaling - 为什么我们只在缩放问题的训练数据中使用 fit() 方法?
- python - 如何在同一图上正确绘制个别年份的月度数据
- performance - 带递归的while循环的时间复杂度
- react-native - React Native Firebase Storage - 尝试使用 .putFile() 保存图像时出错
- google-api - Google Calendar API - 如何保存/使用 StoredCredentials?
- java - 使用主要活动中的按钮更改第二个活动的颜色=崩溃
- python - Python Text Clean 删除超链接