colorSpectrum: Create N Distinct Plot Colors

Creates N distinct three-element RPB vectors for plotting

Vous suivez désormais cette soumission

For a consistent plot lines coloring scheme. Returns a color spectrum from red to green to blue. Avoids colors that are hard to see in matlab plots, such as yellow and cyan.

Three Easy Directions:
Obtain N curves or lines to plot: Data.
Type: C = colorSpectrum(N);
Plot: figure,hold on,for i = 1:N,plot(Data(i,:),'Color',C(i,:)),end,hold off

Citation pour cette source

Kirk (2026). colorSpectrum: Create N Distinct Plot Colors (https://fr.mathworks.com/matlabcentral/fileexchange/44589-colorspectrum-create-n-distinct-plot-colors), MATLAB Central File Exchange. Extrait(e) le .

Remerciements

A inspiré : Maximally Distinct Color Generator

Catégories

En savoir plus sur Color and Styling dans Help Center et MATLAB Answers

Informations générales

Compatibilité avec les versions de MATLAB

  • Compatible avec toutes les versions

Plateformes compatibles

  • Windows
  • macOS
  • Linux
Version Publié le Notes de version Action
1.2.0.0

Made some corrections in comments and description.

1.1.0.0

Fixed small typo