How can i change colors of data in a 2D plot?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Umair Ahmed
le 19 Mar 2020
Commenté : Ameer Hamza
le 19 Mar 2020
hi, i am making a 2D plot and have multiple data which i want to be different colors. i used colormaps (lines, parula, prism).. but proble with them is after 3-4 data points the same color gets repeated again and again, and i not able to distinguish between data? can anyone help?
Thanks
1 commentaire
Ameer Hamza
le 19 Mar 2020
The colors of lines made using plot() function is decided by the ColorOrder property of axes not Colormap.
Réponse acceptée
Ameer Hamza
le 19 Mar 2020
Modifié(e) : Ameer Hamza
le 19 Mar 2020
One way is to increase the colors in the ColorOrder property of the axes. For example, try
rng(0);
ax = axes();
ax.ColorOrder = rand(100, 3);
hold(ax);
%% now run the plot commands.
4 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Colormaps dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!