'Setting color maps in different gradient

As an example, I have a dataset ranging from 0 to 1.5. And the data is not distributed in normal distribution; from 0 to 0.1 is much more than 0.1 to 1.0. Now, I would like to allocate color map with different gradient using "vlag". Normally, the intermediate color (in this case white) is automatically allocated to the intermediate value (in this case 0.5). But I want to allocate white color to 0.1 and make heatmap with different color gradient; from 0(blue) to 0.1(white) and from 0.1(white) to 1.0(red) Can I do this by seaborn?

import copy
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np


cmap = copy.copy(plt.get_cmap("vlag"))
cmap.set_under('#002a85')
sns.heatmap(df, cmap=cmap,yticklabels =df_heat.iloc[:,0], vmin=1e-7)

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source