为什么我的混淆矩阵被切断了?

why are my confusion matrices getting cut off?

当我使用 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 升级到最新版本 (3.1.3) 应该可以解决问题:

conda update matplotlib

如果您使用的是 Anaconda 或者

pip install -U matplotlib

否则,你应该得到: