Skip to content

Commit 480f728

Browse files
Noticed a bug with multiple plots
1 parent 79dc240 commit 480f728

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

plotly/_subplots.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,8 +916,10 @@ def update_axis_matches(first_axis_id, subplot_ref, spec, remove_label):
916916

917917
if x_or_y == "x":
918918
span = spec["colspan"]
919+
match_axis = 'xaxis'
919920
else:
920921
span = spec["rowspan"]
922+
match_axis = 'yaxis'
921923

922924
if subplot_ref.subplot_type == "xy" and span == 1:
923925
if first_axis_id is None:
@@ -926,7 +928,7 @@ def update_axis_matches(first_axis_id, subplot_ref, spec, remove_label):
926928
else:
927929
axis_name = subplot_ref.layout_keys[layout_key_ind]
928930
axis_to_match = layout[axis_name]
929-
subplot_ref.trace_kwargs[axis_name] = first_axis_id # Changes the reference axis in the set up to the initial axis (the axis to match)
931+
subplot_ref.trace_kwargs[match_axis] = first_axis_id # Changes the reference axis in the set up to the initial axis (the axis to match)
930932
axis_to_match.matches = first_axis_id
931933
if remove_label:
932934
axis_to_match.showticklabels = False

0 commit comments

Comments
 (0)