I have making a heatmap with a mask. Here is a toy MWE:
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
images = []
vmin = 0
vmax = 80
cmap = "viridis"
size = 40
matrix = np.random.randint(vmin, vmax, size=(size,size))
np.random.seed(7)
mask = []
for _ in range(size):
prefix_length = np.random.randint(size)
mask.append([False]*prefix_length + [True]*(size-prefix_length))
mask = np.array(mask)
sns.heatmap(matrix, vmin=vmin, vmax=vmax, cmap="viridis", mask=mask)
plt.savefig("temp.png")
plt.show()
I want to draw a line around the edge of the mask to accentuate where it is. How can you do that?
My toy example currently looks like this: