If there are more than 10 traces during making Scatter chart, the color of the lines or spots will repeat, which makes distinguishing difficult.
any way to revise itοΌ
FYI, below code and output as an expample:
fig = go.Figure()
for crop_year, group in df_fig.groupby('Crop_Year'):
fig.add_trace(
go.Scatter(x=group['Value'], y=group['CLOSE'], marker=dict(size=10, line=dict(width=2)),
name=crop_year)
)
yes, got it. it works perfectly when drawing fig with px function. thanks very much!
what if drawing the fig with add_trace() function like my example?
import plotly.graph_objects as go
import numpy as np
fig = go.Figure(layout={'height':600, 'width':600, 'colorway':px.colors.qualitative.Alphabet})
for _ in range(26):
fig.add_scatter(
x=np.arange(10),
y=np.random.randint(1, 20, size=(10)),
mode='markers'
)
fig.show()