I have three traces, one of which I have in one subplot, and two of which are in another. I would like to have a distinct y-axis each of the traces in the subplot with 2 traces.
For example, I have
fig = plotly.tools.make_subplots(rows=2, cols=1, shared_xaxes=True)
fig.append_trace(trace1, 1, 1)
fig.append_trace(trace2, 1, 1)
fig.append_trace(trace3, 2, 1)
fig['layout'].update(height=200, width=400)
which produces
And when I have no subplots, I can get a second axis for the second trace with
layout = go.Layout(
yaxis=dict(
title='y for trace1'
),
yaxis2=dict(
title='y for trace2',
titlefont=dict(
color='rgb(148, 103, 189)'
),
tickfont=dict(
color='rgb(148, 103, 189)'
),
overlaying='y',
side='right'
)
)
fig = go.Figure(data=data, layout=layout)
which produces
But I can't figure out how to get the first subplot in the first example to look like the plot in the second example: with a distinct axis for the second trace there.
How do I add an axis for a second trace in a Plotly subplot?