def get_color_map()

in amazon_comprehend_events_tutorial/notebooks/events_graph.py [0:0]


def get_color_map(tags):
    spectral = cm.get_cmap("Spectral", len(tags))
    tag_colors = [colors.rgb2hex(spectral(i)) for i in range(len(tags))]
    color_map = dict(zip(*(tags, tag_colors)))
    color_map.update({'ROLE': 'grey'})
    return color_map