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
Based on Ali's and Champitoad's answer:
If you want to try different palettes for the same, you can do this in a few lines:
cmap=plt.cm.get_cmap(plt.cm.viridis,143)
^143 being the number of colours you're sampling
I picked 143 because the entire range of colours on the colormap comes into play here. What you can do is sample the nth colour every iteration to get the colormap effect.
n=20
for i,(x,y) in enumerate(points):
plt.scatter(x,y,c=cmap(n*i))