I have a heatmap in Seaborn via sns.heatmap
. I now want to white out the bottom row and right column but keep the values.
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
np.random.seed(2021)
df = pd.DataFrame(np.random.normal(0, 1, (6, 4))
df = df.rename(columns = {0:"a", 1:"b", 2:"c", 3:"d"})
df.index = [value for key, value in {0:"a", 1:"b", 2:"c", 3:"d", 4:"e", 5:"f"}.items()]
sns.heatmat(df, annot = True)
plt.show
I thought I had to include a mask
argument in my sns.heatmap
call, but I am not having success giving a proper mask
, and the mask removes the annotation. I also need to preserve the text indices of my data frame d
. How can I get those cells whited out while preserving the text indices?