How to plot curves sequentially with different colours automatically?

9 visualizaciones (últimos 30 días)
Mr M.
Mr M. el 19 de Mayo de 2015
Respondida: Joseph Cheng el 19 de Mayo de 2015
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.

Respuestas (1)

Joseph Cheng
Joseph Cheng el 19 de Mayo de 2015
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

Categorías

Más información sobre Smoothing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by