Assign specific color to seaborn heatmap
问题 I'm trying to make heatmap using seaborn, but got stuck to change color on specific values. Suppose, the value 0 should be white, and value 1 should be grey, then over that uses the palette as provided by cmap. Was trying to use mask, but got confused. import matplotlib.pyplot as plt import numpy as np import seaborn as sns import pandas as pd df = pd.read_csv('/home/test.csv', index_col=0) fig, ax = plt.subplots() sns.heatmap(df, cmap="Reds", vmin=0, vmax=15) plt.show() this for the sample