Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b69cbe5

Browse filesBrowse files
committed
Set default draggable to False and fixed testcase
1 parent bd78a19 commit b69cbe5
Copy full SHA for b69cbe5

File tree

Expand file treeCollapse file tree

2 files changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-3
lines changed

‎lib/matplotlib/legend.py

Copy file name to clipboardExpand all lines: lib/matplotlib/legend.py
+2-2Lines 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

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_legend.py
+1-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.