In user @SimonGibbons' answer to Add custom border to certain cells in a matplotlib / seaborn plot
a cell is highlighted via:
ax = g.ax_heatmap
ax.add_patch(Rectangle((3, 4), 1, 1, fill=False, edgecolor='blue', lw=3))
notably, the line width (lw
), here is set to 3. When highlighting a cell at the edge of the plot, I have found that the line gets cut off as half of the line width is inside the plot and half outside.
How can I add lw / 2 padding to the frame of the heat map using seaborn to see the entire highlighted area?