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

Check for legend existing before using in _correct_for_scroll_event_on_legend #38015

Merged
merged 1 commit into from
Sep 19, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def _get_next_axis_scale(self, current_scale):
def _correct_for_scroll_event_on_legend(self, event):
# Corrects default behaviour in Matplotlib where legend is picked up by scroll event
legend = event.inaxes.axes.get_legend()
if legend.get_draggable() and legend.contains(event):
if legend is not None and legend.get_draggable() and legend.contains(event):
legend_set_draggable(legend, False)
legend_set_draggable(legend, True)

Expand Down
Loading