What\'s the trivial example of how to generate random colors for passing to plotting functions?
I\'m calling scatter inside a loop and want each plot a different col
elaborating @john-mee 's answer, if you have arbitrarily long data but don't need strictly unique colors:
for python 2:
from itertools import cycle
cycol = cycle('bgrcmk')
for X,Y in data:
scatter(X, Y, c=cycol.next())
for python 3:
from itertools import cycle
cycol = cycle('bgrcmk')
for X,Y in data:
scatter(X, Y, c=next(cycol))
this has the advantage that the colors are easy to control and that it's short.