def edge_width_weight(G,edgelist=None):
    if edgelist is None:
        edgelist = G.edges()
    lw = {}
    for (u,v) in edgelist:
        lw[(u,v)] = G.edge[u][v]['weight']
    maxw = max(lw.values())
    minw = float(min(lw.values())) #to ensure floats later
    return dict(list(zip(list(lw.keys()), \
                    list(map((lambda x: 19.5*((x-minw)/(maxw-minw)) + 0.5), \
                        list(lw.values()))))))
Automatically calculate a normalized reasonable line width for
dataset/ETHPy150Open calliope-project/calliope/calliope/lib/nx_pylab.py/edge_width_weight