Skip to content

Commit 8ba18f7

Browse files
Fix #5427 - Line not shared across matched axes
- Bug was that function marked the axis to be connected, but the trace_kwargs still had unique axes - Change: change the keyword argument for the trace, so that when the graph is initialized, it uses the correct axis instead of the autogenerated one - Note: The program generates a unique axis label for each subgraph, and then overwrites the label (under this fix)
1 parent 0982e25 commit 8ba18f7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

plotly/_subplots.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,7 @@ def update_axis_matches(first_axis_id, subplot_ref, spec, remove_label):
926926
else:
927927
axis_name = subplot_ref.layout_keys[layout_key_ind]
928928
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)
929930
axis_to_match.matches = first_axis_id
930931
if remove_label:
931932
axis_to_match.showticklabels = False
@@ -981,6 +982,7 @@ def update_axis_matches(first_axis_id, subplot_ref, spec, remove_label):
981982
first_axis_id = update_axis_matches(
982983
first_axis_id, subplot_ref, spec, ok_to_remove_label
983984
)
985+
984986

985987

986988
def _init_subplot_xy(layout, secondary_y, x_domain, y_domain, max_subplot_ids=None):

0 commit comments

Comments
 (0)