I have points in R
clusters. I want create a figure, iterate these R
clusters and in each iteration i
, draw points (scatter
) from cluster i
with color, that'll be perceptually different from colors of points in other clusters.
In Octave/Matlab, I'd just do
colors = hsv(R);
figure; hold on;
for i = 1:R
...
c = colors(i,:);
% draw with color c
...
end
and each line/set of points would be easily distinguishable from others in the resulting figure. I'm missing this magical hsv(n)
function in Matplotlib. I was surprised that I couldn't google it in less than 5 minutes for Matplotlib so hopefully, it'll serve as a reference for other lazy ones.
EDIT:
@ImportanceOfBeingErnest is correct. Also, Matplotlib, unlike Matlab, assigns different color for each plot operation: https://stackoverflow.com/a/16006929/214720