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

Fix legend dragging. #16105

Merged
merged 1 commit into from Jan 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/matplotlib/legend.py
Expand Up @@ -74,10 +74,10 @@ def artist_picker(self, legend, evt):
return self.legend.contains(evt)

def finalize_offset(self):
update_method = cbook._check_getitem(
{"loc": self._update_loc, "bbox": self._bbox_to_anchor},
update=self._update)
update_method(self.get_loc_in_canvas())
if self._update == "loc":
self._update_loc(self.get_loc_in_canvas())
elif self._update == "bbox":
self._bbox_to_anchor(self.get_loc_in_canvas())

def _update_loc(self, loc_in_canvas):
bbox = self.legend.get_bbox_to_anchor()
Expand Down