plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

matching secondary_y range to primary by each row of subplots

Open mesut-yasar opened this issue 3 years ago • 1 comments

Hi, I have a subplot with 1 column and 5 rows. each plot in a row has a secondary_y axis. I would like to match the range of secondary_y and primary_y axis to each other, whichever has the max. I have been searching for quite some time, but could not find anything.

image

image

mesut-yasar avatar Jun 16 '22 05:06 mesut-yasar

matches is the right attribute, but you need to figure out the specific axes you're trying to match - I'm not sure what order make_subplots puts the axes in but you presumably have y, y2, y3, and y4... so it's probably either:

fig.update_layout(yaxis4_matches='y')

or

fig.update_layout(yaxis3_matches='y2')

alexcjohnson avatar Jun 21 '22 16:06 alexcjohnson