Masking annotations in seaborn heatmap
问题 I would like to make a heatmap that has annotation only in specific cells. I though one way to do this would be to make a heatmap with annotations in all cells and then overlay another heatmap that has no annotation but that is masked in the regions that I want the original annotations to be visible: import numpy as np import seaborn as sns par_corr_p = np.array([[1, 2], [3, 4]]) masked_array = np.ma.array(par_corr_p, mask=par_corr_p<2) fig, ax = plt.subplots() sns.heatmap(par_corr_p, ax=ax,