Empet,
thanks very much for your reply!
I am confused now.
So is it the case that I should:
1 append the traces to the correct row and column (within the subplot table)
2 define the layout to include two y-axes(left and right)
3 update each trace within the data to impose those are plotted against the correct axis (I don’t understand why this step is required)
My traces were appended with the following code in the first place:
trace_He = Scatter(
x=df52_all.index,
y=df52_all['He_'+column],
line = dict(
color = ('rgba(138,191,63,1.0)'),
width = 1,
),
fill='tozeroy',
fillcolor = ('rgba(138,191,63,0.25)'),
name='He_'+column,
text='He_'+column,
xaxis='x'+str(i),
yaxis='y'+str(i+no_charts),
)
fig_tm52.append_trace(trace_He,row=row,col=col)
trace_We = Bar(
x=df52_all.index,
y=df52_all['We_'+column],
marker=dict(color = ('rgba(220,129,34,1.0)')),
name='We_'+column,
text='We_'+column,
xaxis='x'+str(i),
yaxis='y'+str(i)
)
fig_tm52.append_trace(trace_We,row=row,col=col)
trace_Ul = Bar(
x=df52_all.index,
y=df52_all['Ul_'+column],
marker=dict(color = ('rgba(200,54,162,1.0)')),
name='Ul_'+column,
text='Ul_'+column,
xaxis='x'+str(i),
yaxis='y'+str(i)
)
fig_tm52.append_trace(trace_Ul,row=row,col=col)
Why do I have to tell plotly a second time that trace_We
and trace_Ul
should plot on 'y'+str(i)
, while He
on 'y'+str(i+no_charts)
?