Adding secondary y to existing plot


I have an existing plotly plot created with the python API using:

fig = tools.make_subplots(rows=1, cols=1)

I’ve appended several traces to this plot.

I would now like to add a secondary y axis to this plot, and append a new trace to that secondary y axis. How can i do this? So far, i tried:

trace2 = go.Scatter(x=rainfall.index, y=rainfall[col],name=‘Rainfall [mm]’, yaxis=‘y2’)


trying using y1 instead of y2 (I know, doesn’t seem to make sense.)