How to plot curves sequentially with different colours automatically?
9 次查看(过去 30 天)
显示 更早的评论
I would like to plot curves with a for cycle and with the "hold on" solution, but it would be nice if the curves have different colours but continuously changing colour scheme.
0 个评论
回答(1 个)
Joseph Cheng
2015-5-19
you can define the colors based on the number of plotted lines. see example:
x= randi(1000,10,100);
clist = colormap(hsv(10));
figure,hold on
for ind = 1:10
plot(x(ind,:),'color',clist(ind,:))
end
legend show
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Smoothing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!