Passing in a list of colours (one for each node in a graph plot)

@laurie Plotly doesn’t work with color codes as tuples of elements in [0,1]. A color should be given either
as a string, 'rgb(125, 57, 230)', or in hex-format, '#5fa023'.

Hence after seting up your 'master_colours' list, convert the color codes to rgb format:

master_colours  = [f'rgb{tuple((np.array(color)*255).astype(np.uint8))}' for color in master_colours]
1 Like