I have a very simple seaborn heatmap:
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)
The output looks like this:
This is different from the expected behavior where (1) annotations are in the center of the box and (2) the y axis labels are also centered and vertical.
My seaborn
version is 0.9.0
and matplotlib
version is 3.1.1
.
I'm confused what's the difference between the script above and numerous other seaborn heatmap tutorials that use the same code but have the texts aligned beautifully.