I have the following code:
filenames=sorted((glob.glob('G*_5.csv')))
cycol=cycle('bgrcmky').next
for fname in ((glob.glob('G*_5.csv'))):
data=np.loadtxt(fname, delimiter=",")
X=data[:,1]
Y=data[:,0]
n=fname.split('_')
plt.plot(X,Y, c=cycol(), linestyle='--', label=n[0], linewidth=3.0 )
plt.title("Damage Patterns 5'")
plt.xlabel("Base")
plt.ylabel("%")
plt.legend(loc='upper right')
plt.xticks([1, 2, 3, 4, 5])
plt.ylim((0,50))
plt.show()
Which gives the following output:
which is fine but I have one problem with the colors since in the cycle('bgrcmky')
I only specified seven colors. But I need ten different ones or more. I landed on this site matplotlib colors where different ways are stated to specify the color. So I tried some of those methods like:
cycol=cycle(["(0.1, 0.2, 0.5)", "(0.1, 0.2, 0.5, 0.3)"]).next
or
cycol=cycle(["xkcd:sky blue", "xkcd:orange"]).next
but these are not working. So is there any way to upgrade the method I used with the cycle to get more then seven colors?
Thanks in advance :)