title: Matplotlib's equivalent of Matlab's hsv(m)
body: <p>I have points in <code>R</code> clusters. I want create a figure, iterate these <code>R</code> clusters and in each iteration <code>i</code>, draw points (<code>scatter</code>) from cluster <code>i</code> with color, that'll be <em>perceptually</em> different from colors of points in other clusters.</p>
  
  <p>In Octave/Matlab, I'd just do</p>
  
  <pre><code>colors = hsv(R);
  figure; hold on;
  for i = 1:R
      ...
      c = colors(i,:);
      % draw with color c
      ...
  end
  </code></pre>
  
  <p>and each line/set of points would be easily distinguishable from others in the resulting figure. I'm missing this magical <a href="https://www.mathworks.com/help/matlab/ref/hsv.html" rel="nofollow noreferrer"><code>hsv(n)</code></a> 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.</p>
  
  <p>EDIT:</p>
  
  <p>@ImportanceOfBeingErnest is correct. Also, Matplotlib, unlike Matlab, assigns different color for each plot operation:
  <a href="https://stackoverflow.com/a/16006929/214720">https://stackoverflow.com/a/16006929/214720</a></p>