- how do I have matplotlib change line markers automatically? [closed]
- import matplotlib.pyplot as plt
- f = plt.figure(1); f.clf()
- ax = f.add_subplot(111)
- ax.plot([1,2,3,4,5])
- ax.plot([5,4,3,2,1])
- ax.plot([2,3,2,3,2])
- import itertools
- for l, ms in zip(ax.lines, itertools.cycle('>^+*')):
- l.set_marker(ms)
- l.set_color('black')
- plt.show()