def custom_div_cmap(numcolors=21, name='custom_div_cmap',
                    mincol='blue', midcol='white', maxcol='red'):
    cmap = LinearSegmentedColormap.from_list(
                    name=name, 
                    colors=[mincol, midcol, maxcol], 
                    N=numcolors
                )
    return cmap
Create a custom diverging colormap with three colors
dataset/ETHPy150Open ml-slac/deep-jets/training/viz/visualize.py/custom_div_cmap