MATLAB: Changing color of graphs in MATLAB plot

colorcolormapjet

I have a basic plot command that is in a loop, and each iteration spits out a graph on the same figure.
There would be about 7000+ plots overlayed on the same figure. I do not inted to use legend, rather I want to use the jet colormap to show the order.
how can I include the jet colormap function in the below command that plots the graphs
plot(timevals,B{k}(:,2),'LineWidth',1.1)
The current figure I get for about 10 iterations is that, I want consitent color changes
jet.PNG

Best Answer

With 7000+ curves, it is unlikely that you are going to be able to distinguish them regardless of the colormap you use.
I would instead use plot3, and offset them slightly in the x-direction, leaving the others unchanged.
Example:
data = rand(5, 20); % Data Vector Matrix
t = linspace(0, 1, size(data,2)); % Time Vector Matrix
x = (0:size(data,1)-1)' * ones(1,size(data,2)); % Offset Vector Matrix
figure
plot3(x, t, data)
grid on