File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -329,6 +329,9 @@ def add_secondary_y(
329329 trace_copy .yaxis = y_mapping [original_yaxis ]
330330 combined .add_trace (trace_copy )
331331
332+ # Get the rightmost secondary y-axis name for linking
333+ rightmost_secondary_y = y_mapping [rightmost_primary_y ]
334+
332335 # Configure secondary y-axes
333336 for primary_yaxis , secondary_yaxis in y_mapping .items ():
334337 is_rightmost = primary_yaxis == rightmost_primary_y
@@ -350,6 +353,8 @@ def add_secondary_y(
350353 "anchor" : x_for_y [primary_yaxis ],
351354 # Only show ticks on the rightmost secondary axis
352355 "showticklabels" : is_rightmost ,
356+ # Link non-rightmost axes to the rightmost for consistent scaling
357+ "matches" : None if is_rightmost else rightmost_secondary_y ,
353358 }
354359 # Remove None values
355360 axis_config = {k : v for k , v in axis_config .items () if v is not None }
You can’t perform that action at this time.
0 commit comments