How can i change colors of data in a 2D plot?
4 次查看(过去 30 天)
显示 更早的评论
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 个评论
Ameer Hamza
2020-3-19
The colors of lines made using plot() function is decided by the ColorOrder property of axes not Colormap.
采纳的回答
Ameer Hamza
2020-3-19
编辑:Ameer Hamza
2020-3-19
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Colormaps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!