How to use a Colorscale with >200 colors?

Hi,
I am using Plotly for network visualization. I am using a Colorscale with an array of community numbers (color_bels) of each node to do the node painting. The problem is when the number of communities increase (200 or more), the Colorscale assign same colors to nodes with different communities. Is there any way to define or use a Colorscale that covers all these different numbers?

marker=dict(symbol=shapes,size=size_labels,colorscale=‘YlGnBu’,reversescale=True, opacity=0.8,
color=color_labels,line=dict(color=‘rgb(0,0,0)’, width=2.0)),

Hi, I used the same colorscale as yours (YlGnBu) for 250 colours.

data = [
    go.Scatter(
        y=[randint(1, 50) for i in np.arange(0, 250)],
        marker=dict(
            size=8,
            color=np.arange(0, 250),
            colorbar=dict(
                title='Colorbar'
            ),
            colorscale='YlGnBu'
        ),
        mode='markers')
]

fig = go.Figure(data=data)

1 Like