Skip to content

Commit 8ce4797

Browse files
committed
Support and test for marker cycling
1 parent 153ef67 commit 8ce4797

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

lib/matplotlib/rcsetup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,9 @@ def __call__(self, s):
593593
'markeredgewidth': validate_floatlist,
594594
'markeredgecolor': validate_colorlist,
595595
'alpha': validate_floatlist,
596+
# No, this isn't a "property", but how long do you think it
597+
# will be before someone requests support for cycling markers?
598+
'marker': validate_stringlist,
596599
}
597600
_prop_aliases = {
598601
'c': 'color',
Loading

lib/matplotlib/tests/test_cycles.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,25 @@ def test_colorcycle_basic():
2323
ax.legend(loc='upper left')
2424

2525

26+
@image_comparison(baseline_images=['marker_cycle'], remove_text=True,
27+
extensions=['png'])
28+
def test_marker_cycle():
29+
fig = plt.figure()
30+
ax = fig.add_subplot(111)
31+
ax.set_prop_cycle(cycler('color', ['r', 'g', 'y']) +
32+
cycler('marker', ['.', '*', 'x']))
33+
xs = np.arange(10)
34+
ys = 0.25 * xs + 2
35+
ax.plot(xs, ys, label='red dot', lw=4, ms=16)
36+
ys = 0.45 * xs + 3
37+
ax.plot(xs, ys, label='green star', lw=4, ms=16)
38+
ys = 0.65 * xs + 4
39+
ax.plot(xs, ys, label='yellow x', lw=4, ms=16)
40+
ys = 0.85 * xs + 5
41+
ax.plot(xs, ys, label='red2 dot', lw=4, ms=16)
42+
ax.legend(loc='upper left')
43+
44+
2645
@image_comparison(baseline_images=['lineprop_cycle_basic'], remove_text=True,
2746
extensions=['png'])
2847
def test_linestylecycle_basic():

0 commit comments

Comments
 (0)