Seaborn热图注释未居中

时间:2019-08-10 20:06:49

标签: python matplotlib seaborn heatmap

我有一个非常简单的seaborn热图:

import seaborn as sns
import pandas as pd
df_cm = pd.read_csv('test_cm.csv',index_col=0)
sns.heatmap(df_cm, annot=True)

输出看起来像这样:

enter image description here

这与预期的行为不同,在预期的行为中,(1)批注位于框的中心,(2)y轴标签也居中且垂直。

我的seaborn版本是0.9.0,而matplotlib版本是3.1.1

我很困惑上面的脚本和其他许多使用相同代码但文本排列精美的seaborn heatmap教程之间的区别。

0 个答案:

没有答案