src/pys5p/tol_colors.py
def discretemap(colormap, hexclrs):
    """
    Produce a colormap from a list of discrete colors without interpolation.
    """
    clrs = to_rgba_array(hexclrs)
    clrs = np.vstack([clrs[0], clrs, clrs[-1]])
    cdict = {}
    for ii, key in enumerate(('red', 'green', 'blue')):
        cdict[key] = [(jj / (len(clrs)-2.), clrs[jj, ii], clrs[jj+1, ii])
                      for jj in range(len(clrs)-1)]
    return LinearSegmentedColormap(colormap, cdict)

    Produce a colormap from a list of discrete colors without interpolation.
    
Produce a colormap from a list of discrete colors without interpolation.
Produce a colormap from a list of discrete colors without interpolation .
def discretemap(colormap, hexclrs):
    clrs = to_rgba_array(hexclrs)
    clrs = np.vstack([clrs[0], clrs, clrs[-1]])
    cdict = {}
    for ii, key in enumerate(('red', 'green', 'blue')):
        cdict[key] = [(jj / (len(clrs)-2.), clrs[jj, ii], clrs[jj+1, ii])
                      for jj in range(len(clrs)-1)]
    return LinearSegmentedColormap(colormap, cdict)
def discretemap ( colormap , hexclrs ) : clrs = to_rgba_array ( hexclrs ) clrs = np . vstack ( [ clrs [ 0 ] , clrs , clrs [ - 1 ] ] ) cdict = { } for ii , key in enumerate ( ( 'red' , 'green' , 'blue' ) ) : cdict [ key ] = [ ( jj / ( len ( clrs ) - 2. ) , clrs [ jj , ii ] , clrs [ jj + 1 , ii ] ) for jj in range ( len ( clrs ) - 1 ) ] return LinearSegmentedColormap ( colormap , cdict )
Produce a colormap from a list of discrete colors without interpolation.
Produce a colormap from a list of discrete colors without interpolation .
"""
    Produce a colormap from a list of discrete colors without interpolation.
    """
colormap
hexclrs