Skip to content

Commit 80a8cd0

Browse files
committed
Legend: Remove x,y list increase readability
1 parent 716ea66 commit 80a8cd0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/matplotlib/tests/test_legend.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,14 +296,14 @@ def test_legend_remove():
296296

297297
def test_reverse_legend():
298298
fig, ax = plt.subplots()
299-
x = [1, 2, 3]
300-
y = [[1, 2, 3], [2, 3, 4], [3, 4, 5]]
299+
x = 1
300+
y = 1
301301
labels = ["First label", "Second label", "Third label"]
302302
markers = ['.', ',', 'o']
303303

304-
ax.plot(x, y[0], markers[0], label=labels[0])
305-
ax.plot(x, y[1], markers[1], label=labels[1])
306-
ax.plot(x, y[2], markers[2], label=labels[2])
304+
ax.plot(x, y, markers[0], label=labels[0])
305+
ax.plot(x, y, markers[1], label=labels[1])
306+
ax.plot(x, y, markers[2], label=labels[2])
307307
leg = ax.legend(reverse=True)
308308
actual_labels = [t.get_text() for t in leg.get_texts()]
309309
actual_markers = [h.get_marker() for h in leg.legend_handles]

0 commit comments

Comments
 (0)