I can't iterate over line_styles (Matplotlib)
<p>Plot generates different colors for each lines but I also need to generate different line_styles for the graph. After searching for some information, I found itertools module. Yet I can't generate plot with the error: <strong>There is no Line2D property "shape_list".</strong></p>

<pre><code>import itertools
from glob import glob
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl

shape_list = ["square", "triangle", "circle", "pentagon", "star", "octagon"]

# loop over all files in the current directory ending with .txt
for fname in glob("*.txt"):
    # read file, skip header (1 line) and unpack into 3 variables
    WL, ABS, T = np.genfromtxt(fname, skip_header=1, unpack=True)
    g = itertools.cycle(shape_list)
    plt.plot(WL, T, label=fname[0:3],shape_list = g.__next__())

plt.xlabel('Wavelength (nm)')
plt.xlim(200,1000)
plt.ylim(0,100)
plt.ylabel('Transmittance (%)')
mpl.rcParams.update({'font.size': 12})
plt.legend(loc=4,prop={'size':10})
plt.grid(True)
#plt.legend(loc='lower center')
plt.savefig('Transmittance', dpi=600)
</code></pre>

<p>The markers you can use with <code>plot</code> are defined <a href="http://matplotlib.org/api/markers_api.html" rel="nofollow">in the documentation</a> </p>

<p>to change the marker style, use the <code>marker=</code> argument to the call to <code>plot()</code></p>

<p>eg:</p>

<pre><code>plt.plot(WL, T, label=fname[0:3], marker=g.__next__())
</code></pre>

python matplotlib