Skip to content

Commit

Permalink
Merge pull request #100 from Carifio24/image-legend
Browse files Browse the repository at this point in the history
Don't show legend for image exports with only one layer
  • Loading branch information
Carifio24 authored Nov 16, 2024
2 parents d17eb91 + c9a8a2c commit a04dfb6
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

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 a04dfb6

Please sign in to comment.