0

I'd like to cycle through three colors for six curves that I am plotting. The first three curves will differ from the second three curves by thickness. However I want curve 1 and curve 4 to have the same color, curve 2 and curve 5, etc. How do I cycle through three colors? Maybe I can just put something before the first line in the else statement that resets the color sequence.

x = []
y1a = []
y1b = []
y1c = []
y2a = []
y2b = []
y2c = []
y =[y1a,y1b,y1c,y2a,y2b,y2c]
ynames = {0:'A',1:'B',2:'C',3:'2A',4:'2B',5:'2C'}

for n in range(0,6,1):
    if len(ynames[n])==1:
        plot(x, y[n], 'x-', label=ynames[n], linewidth='4')
    elif len(ynames[n])==2:
        plot(x, y[n], 'x-', label=ynames[n], linewidth='8')
    xlabel("Ex")
    ylabel("Why")
Joseph Clifford
  • 365
  • 1
  • 3
  • 5
  • I mean I guess can define another dictionary that has the colors I want and cycle through those but is there a way that I can cycle through the same three colors without defining anything? – Joseph Clifford May 22 '13 at 20:52
  • @mgilson I think that _question_ is the answer to this one. – tacaswell May 22 '13 at 21:33

0 Answers0