This question already has an answer here:
I am plotting heatmap of features but the feature names on x and y axes conincide with each other. So how can I align x axis feature names vertically and y axis feature names horizontally so that they do not overlap.
Code:
%matplotlib notebook
corr = data.loc[:,'PERID':'PRXRETRY'].corr()
sns.set(font_scale=0.8)
sns.heatmap(corr,
xticklabels=corr.columns.values,
yticklabels=corr.columns.values,cmap="YlGnBu",annot=True)
Screenshot:
This works for me: