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

Skip to content

Commit b69cbe5

Browse files
committed
Set default draggable to False and fixed testcase
1 parent bd78a19 commit b69cbe5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/matplotlib/legend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def _update_bbox_to_anchor(self, loc_in_canvas):
287287
handler. This *handler_map* updates the default handler map
288288
found at `matplotlib.legend.Legend.get_legend_handler_map`.
289289
290-
draggable : bool or None
290+
draggable : bool, default: False
291291
Whether the legend can be dragged with the mouse.
292292
""")
293293

@@ -346,7 +346,7 @@ def __init__(
346346
alignment="center", # control the alignment within the legend box
347347
*,
348348
ncol=1, # synonym for ncols (backward compatibility)
349-
draggable=None # whether the legend can be dragged with the mouse
349+
draggable=False # whether the legend can be dragged with the mouse
350350
):
351351
"""
352352
Parameters

lib/matplotlib/tests/test_legend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ def test_legend_draggable(draggable):
788788
fig, ax = plt.subplots()
789789
ax.plot(range(10), label='shabnams')
790790
leg = ax.legend(draggable=draggable)
791-
assert leg.get_draggable() == draggable
791+
assert leg.get_draggable() is draggable
792792

793793

794794
def test_alpha_handles():

0 commit comments

Comments
 (0)