Reputation: 22933
In Matplotlib, I have several sets of points to fill in with different colours, one per set. Now, the number of sets varies, so I would like to make sure that that the same colour doesn't appear more than once in the same plot.
Right now I just do:
colors = itertools.cycle(['r','g','b','c','y','m'])
# ...
ax.plot(Xs_for_a_set, Ys_for_a_set, c=colors.next())
... but I am limited to that number of colors. From the documentation I don't get how to specify a random color in RGB...
Upvotes: 1
Views: 87
Reputation: 11741
You can specify the color as a hex value in a string.
color = '#eeefff'
Using this you essentially have access to all colors via RGB and can create as many colors as you need
Upvotes: 1