Change color of missing values in Seaborn heatmap

You can use the following code:

corr = np.corrcoef(np.random.randn(10, 200))
mask = np.zeros_like(corr)
mask[np.triu_indices_from(mask)] = True
g = sns.heatmap(corr, mask=mask, vmax=.3, square=True)
g.set_facecolor('xkcd:salmon')

You need to use set_facecolor on the plot object. Change to any colour you want.

Resulting in this graph:

enter image description here


Another alternative would be to set the active style parameters in seaborn using sns.set_style():

sns.set_style("white",  {'figure.facecolor': 'black'})
corr = np.corrcoef(np.random.randn(10, 200))
mask = np.zeros_like(corr)
mask[np.triu_indices_from(mask)] = True
sns.heatmap(corr, mask=mask, vmax=.3, square=True)
plt.axis("off")
plt.show()

An entire list of parameters can be found here: https://seaborn.pydata.org/tutorial/aesthetics.html#overriding-elements-of-the-seaborn-styles