10000 Merge pull request #16105 from anntzer/legenddrag · matplotlib/matplotlib@a6f5a28 · GitHub
[go: up one dir, main page]

Skip to content

Commit a6f5a28

Browse files
authored
Merge pull request #16105 from anntzer/legenddrag
Fix legend dragging.
2 parents d68bb04 + 12d800d commit a6f5a28

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/legend.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ def __init__(self, legend, use_blit=False, update="loc"):
7171
use_blit=use_blit)
7272

7373
def finalize_offset(self):
74-
update_method = cbook._check_getitem(
75-
{"loc": self._update_loc, "bbox": self._bbox_to_anchor},
76-
update=self._update)
77-
update_method(self.get_loc_in_canvas())
74+
if self._update == "loc":
75+
self._update_loc(self.get_loc_in_canvas())
76+
elif self._update == "bbox":
77+
self._bbox_to_anchor(self.get_loc_in_canvas())
7878

7979
def _update_loc(self, loc_in_canvas):
8080
bbox = self.legend.get_bbox_to_anchor()

0 commit comments

Comments
 (0)
0