custom color map#

[1]:
colors = ["#ffffcc", "#a1dab4", "#41b6c4", "#2c7fb8", "#253494"]

from matplotlib.colors import LinearSegmentedColormap, ListedColormap

cmap4 = LinearSegmentedColormap.from_list(
    "tc1",
    [
        (0, colors[0]),
        (0.05, colors[1]),
        (0.1, colors[2]),
        (0.15, colors[3]),
        (1, colors[4]),
    ],
    N=256,
)
cmap4_r = cmap4.reversed()
[2]:
cmap4_r
[2]:
tc1_r
tc1_r colormap
under
bad
over