Skip to content

Commit 296acb4

Browse files
committed
TST: Added test for legend with markers to the right of labels
1 parent d1bac23 commit 296acb4

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lib/matplotlib/tests/test_legend.py

+12
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,18 @@ def test_various_labels():
6464
ax.legend(numpoints=1, loc=0)
6565

6666

67+
@image_comparison(baseline_images=['legend_labels_first'], extensions=['png'],
68+
remove_text=True)
69+
def test_labels_first():
70+
# test labels to left of markers
71+
fig = plt.figure()
72+
ax = fig.add_subplot(111)
73+
ax.plot(np.arange(10), '-o', label=1)
74+
ax.plot(np.ones(10)*5, ':x', label="x")
75+
ax.plot(np.arange(20, 10, -1), 'd', label="diamond")
76+
ax.legend(loc=0, markerfirst=False)
77+
78+
6779
@image_comparison(baseline_images=['fancy'], remove_text=True)
6880
def test_fancy():
6981
# using subplot triggers some offsetbox functionality untested elsewhere

0 commit comments

Comments
 (0)