【问题标题】:why are my confusion matrices getting cut off?为什么我的混淆矩阵被切断了?
【发布时间】:2020-05-21 23:05:14
【问题描述】:

当我使用sns.heatmap(data) 时,我的结果总是会被截断。

我用来做这个的代码是:

sns.heatmap(pd.DataFrame([[.2, .2, .3], 
                          [.1, .7, .9],
                          [.9, .6, .2]], 
                         columns = ['c1', 'c2', 'c3'],
                         index = ['c1', 'c2', 'c3']), 
            robust = True, annot = True)

我正在使用 spyder 4.0.1,知道发生了什么吗?

【问题讨论】:

  • 你的 matplotlib 版本是多少?

标签: python python-3.x matplotlib seaborn spyder


【解决方案1】:

将 matplotlib 升级到最新版本(3.1.3)应该可以解决问题:

conda update matplotlib

如果您使用 Anaconda 或

pip install -U matplotlib

否则,你应该得到:

【讨论】:

  • 效果很好!谢谢!
猜你喜欢
  • 2019-11-14
  • 2011-04-12
  • 1970-01-01
  • 2021-04-18
  • 2019-09-28
  • 2020-01-16
  • 2014-07-09
  • 2015-12-17
  • 2020-10-01
相关资源
最近更新 更多