Commit 12d800d
committed
Fix legend dragging.
Without this PR, after
```
plot([1, 2], label="foo"); legend().set_draggable(True)
```
when dragging the legend, releasing the mouse button results in
```
Traceback (most recent call last):
File ".../matplotlib/cbook/__init__.py", line 236, in process
func(*args, **kwargs)
File ".../matplotlib/offsetbox.py", line 1716, in on_release
self.finalize_offset()
File ".../matplotlib/legend.py", line 78, in finalize_offset
{"loc": self._update_loc, "bbox": self._bbox_to_anchor},
AttributeError: 'DraggableLegend' object has no attribute '_bbox_to_anchor'
```
See comment in code for more explanations.
A test may be nice but tricky to write...1 parent f4c25b2 commit 12d800d
1 file changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
0 commit comments