Skip to content

Commit

Permalink
Set showlegend for image exporters based on layer count.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carifio24 committed Nov 16, 2024
1 parent 24ad941 commit c9a8a2c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions glue_plotly/html_exporters/jupyter/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def save_figure(self, filepath):
config.update(**ax)
secondary_x = 'xaxis2' in ax
secondary_y = 'yaxis2' in ax
config["showlegend"] = len(layers) > 1

if secondary_x or secondary_y:
fig = make_subplots(specs=[[{"secondary_y": True}]], horizontal_spacing=0, vertical_spacing=0)
Expand Down
1 change: 1 addition & 0 deletions glue_plotly/html_exporters/qt/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def _export_to_plotly(self, filename, checked_dictionary):
config.update(**ax)
secondary_x = 'xaxis2' in ax
secondary_y = 'yaxis2' in ax
config["showlegend"] = len(layers) > 1

Check warning on line 47 in glue_plotly/html_exporters/qt/image.py

View check run for this annotation

Codecov / codecov/patch

glue_plotly/html_exporters/qt/image.py#L47

Added line #L47 was not covered by tests

if secondary_x or secondary_y:
fig = make_subplots(specs=[[{"secondary_y": True}]], horizontal_spacing=0, vertical_spacing=0)
Expand Down

0 comments on commit c9a8a2c

Please sign in to comment.