I was making a Seaborn heatmap and all went well, except for the fact that the border squares (top, right, bottom, left) are trimmed off...
Does anyone know how to fix this?
Please see my code below:
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from scipy.stats import norm
df_train = pd.read_csv('SongFeaturesTEST.csv')
# print(df_train.columns)
# print(df_train.corr())
# print(df_train.describe().T)
corrmat = df_train.corr(method='spearman')
f, ax = plt.subplots(figsize=(5, 5))
sns.heatmap(corrmat, ax = ax, cmap="RdBu", linewidths=0.1, annot=True, annot_kws={"size": 5})
plt.xticks(rotation=45, fontsize='5')
plt.yticks(fontsize='5')
plt.show()