Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit df536f0

Browse files
authored
Merge pull request #16124 from meeseeksmachine/auto-backport-of-pr-16105-on-v3.2.x
Backport PR #16105 on branch v3.2.x (Fix legend dragging.)
2 parents a283545 + 4bd8814 commit df536f0

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/matplotlib/legend.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ def artist_picker(self, legend, evt):
7474
return self.legend.contains(evt)
7575

7676
def finalize_offset(self):
77-
update_method = cbook._check_getitem(
78-
{"loc": self._update_loc, "bbox": self._bbox_to_anchor},
79-
update=self._update)
80-
update_method(self.get_loc_in_canvas())
77+
if self._update == "loc":
78+
self._update_loc(self.get_loc_in_canvas())
79+
elif self._update == "bbox":
80+
self._bbox_to_anchor(self.get_loc_in_canvas())
8181

8282
def _update_loc(self, loc_in_canvas):
8383
bbox = self.legend.get_bbox_to_anchor()

0 commit comments

Comments
 (0)