Align Multiple Y axis to one value in Plotly

Hi Kansai,

Had a similar problem to yours. I found that by extending both axis ranges to include 0, e.g.,

fig.update_yaxes(rangemode='tozero')

I could align the zeroline of both axes, like so:


Furthermore, constraining the axes to scale with each other causes their values to line up completely:

fig.update_yaxes(rangemode='tozero', scaleanchor='y', scaleratio=1, constraintoward='bottom', secondary_y=True)
fig.update_yaxes(rangemode='tozero', scaleanchor='y2', scaleratio=1, constraintoward='bottom', secondary_y=False)


Hope this helps!