def norm_cmap(values, cmap, normalize, cm, vmin=None, vmax=None):

    mn = min(values) if vmin is None else vmin
    mx = max(values) if vmax is None else vmax
    norm = normalize(vmin=mn, vmax=mx)
    n_cmap = cm.ScalarMappable(norm=norm, cmap=cmap)
    return n_cmap
Normalize and set colormap
dataset/ETHPy150Open geopandas/geopandas/geopandas/plotting.py/norm_cmap