Skip to content

Commit bd78a19

Browse files
committed
added a test case for the legend's draggable param
1 parent 32efbdb commit bd78a19

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/matplotlib/tests/test_legend.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,14 @@ def test_get_set_draggable():
783783
assert not legend.get_draggable()
784784

785785

786+
@pytest.mark.parametrize('draggable', (True, False))
787+
def test_legend_draggable(draggable):
788+
fig, ax = plt.subplots()
789+
ax.plot(range(10), label='shabnams')
790+
leg = ax.legend(draggable=draggable)
791+
assert leg.get_draggable() == draggable
792+
793+
786794
def test_alpha_handles():
787795
x, n, hh = plt.hist([1, 2, 3], alpha=0.25, label='data', color='red')
788796
legend = plt.legend()

0 commit comments

Comments
 (0)