Hi @hamoudie12
You can do it using the following steps:
You can do it like this:
-
Set (or find) appropriate minimum and maximum values for your y-axis,
-
adjust your y ranges using
fig.update_layout(yaxis=dict(range=[all_min,all_max]), yaxis2=dict(range=[all_min,all_max]))
, and -
set the
scaleanchor
of your secondary y-axis toy1
like this:fig.update_layout(yaxis2=dict(scaleanchor = 'y1'))
If the source of your figure data is a pandas DataFrame, there are more elegant ways of finding global max and min values than just hard-coding them in there.
Check out other methods here: