Skip to content

Commit 165187e

Browse files
committed
added legend to markevery tests
svn path=/trunk/matplotlib/; revision=6632
1 parent 83a8420 commit 165187e

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

unit/nose_tests.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import nose, nose.tools as nt
44
import numpy.testing as nptest
55

6+
67
import matplotlib
78
matplotlib.use('Agg')
89
import matplotlib.pyplot as plt
@@ -20,20 +21,22 @@ def test_markevery():
2021
# check marker only plot
2122
fig = plt.figure()
2223
ax = fig.add_subplot(111)
23-
ax.plot(x, y, 'o')
24-
ax.plot(x, y, 'd', markevery=None)
25-
ax.plot(x, y, 's', markevery=10)
26-
ax.plot(x, y, '+', markevery=(5, 20))
24+
ax.plot(x, y, 'o', label='default')
25+
ax.plot(x, y, 'd', markevery=None, label='mark all')
26+
ax.plot(x, y, 's', markevery=10, label='mark every 10')
27+
ax.plot(x, y, '+', markevery=(5, 20), label='mark every 5 starting at 10')
28+
ax.legend()
2729
fig.canvas.draw()
2830
plt.close(fig)
2931

3032
# check line/marker combos
3133
fig = plt.figure()
3234
ax = fig.add_subplot(111)
33-
ax.plot(x, y, '-o')
34-
ax.plot(x, y, '-d', markevery=None)
35-
ax.plot(x, y, '-s', markevery=10)
36-
ax.plot(x, y, '-+', markevery=(5, 20))
35+
ax.plot(x, y, '-o', label='default')
36+
ax.plot(x, y, '-d', markevery=None, label='mark all')
37+
ax.plot(x, y, '-s', markevery=10, label='mark every 10')
38+
ax.plot(x, y, '-+', markevery=(5, 20), label='mark every 5 starting at 10')
39+
ax.legend()
3740
fig.canvas.draw()
3841
plt.close(fig)
3942

0 commit comments

Comments
 (0)