0

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...

enter image description here

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()
beyondtdr
  • 411
  • 6
  • 17
  • 1
    This is a known problem with the latest version of `matplotlib` refer to the question I flagged as duplicate to check your solution – Juan C Oct 18 '19 at 13:33
  • Thanks a lot. Found it tough to google it correctly as I could not find a solution – beyondtdr Oct 18 '19 at 13:38

0 Answers0