Set up range for y2-axis (subplots)

I would like to set up the range for y2-axis (subplots).

I was able to set up the range for the y1-axis as follows:

fig.update_layout(yaxis_range=[LCL-0.5,UCL+0.5])

How can i do the same with the y2-axis?

@pitS

Update yaxis2 in the same way:

fig.update_layout(yaxis_range=[LCL-0.5, UCL+0.5],
                 yaxis2_range=[1, 15])
1 Like

Thank you, it works well. Before I tried

fig.update_layout(y2axis_range=[LCL-0.5,UCL+0.5])

and now i know, why i did not work.

Hi,
I have 4 subplots and i want to set different ranges for the secondary y axis of each plot. The snippet above doesn’t work on each subplot individually nor this functions takes row and col as argument. Do you have a solution to this?

TIA.

-Pranay