I know how to cycle through a list of colors in matplotlib. But is it possible to do something similar with line styles (plain, dotted, dashed, etc.)? I'd need to do that so my graphs would be easier to read when printed. Any suggestions how to do that?
Something like this might do the trick:
import matplotlib.pyplot as plt from itertools import cycle lines = ["-","--","-.",":"] linecycler = cycle(lines) plt.figure() for i in range(10): x = range(i,i+10) plt.plot(range(10),x,next(linecycler)) plt.show()