fig = go.Figure(data=go.Scatter(
y = np.random.randn(500),mode='markers',
marker=dict(
size=24,
color=np.random.randn(500), #set color equal to a variable
colorscale='RdBu', # one of plotly colorscales
showscale=True)
))
fig.update_layout(template= 'plotly_dark')
fig.show()