Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't show legend for image exports with only one layer #100

Merged
merged 1 commit into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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
Loading