I have the following, using plotly express:
fig = px.line(series1, x='timestamp', y='data')
fig.show()
and it works properly.
I want to make multiple plots together, so I did:
fig = make_subplots(rows=2, cols=1)
fig.add_trace(px.line(series1, x='timestamp', y='data'), row=1, col=1)
fig.add_trace(px.line(series2, x='timestamp', y='data'), row=1, col=1)
fig.add_trace(px.line(series2, x='timestamp', y='data'), row=2, col=1)
fig.show()
but I get:
Invalid element(s) received for the 'data' property of Invalid elements include: [Figure({ 'data': [{'hoverlabel': {'namelength': 0},
although,
fig = make_subplots(rows=1, cols=2)
fig.add_trace(go.Scatter(x=series1['timestamp'], y=series1['data']), row=1, col=1)
fig.add_trace(go.Scatter(x=series2['timestamp'], y=series2['data']), row=1, col=1)
fig.add_trace(go.Scatter(x=series2['timestamp'], y=series2['data']), row=1, col=2)
fig.show()
will work; so it looks like plotly express doesn't work with subplots.
did I miss anything?
additionally, as a bonus question: I haven't found how I can specify the color for each of the traces.