Reputation: 29
I'm plotting cell arrays against each other and I want certain groups of points to have the same color. I made a new color order matrix and all the points changed to the correct color EXCEPT the very first one. It's stuck on the default blueish color.
The variables are contained in cells so I'm looping through to make the figure.
C = [1 0 0; 1 0 0; 1 0 0; 1 0 0;...
0 1 1; 0 1 1;...
1 1 0; 1 1 0; 1 1 0; 1 1 0];
for k = 1:numFiles
hold all
plot(zonal{k}, deltaT{k},'*','MarkerSize',11);
set(gca,'ColorOrder',C);
end
C contains the correct number of rgb triplets. Is this an easy fix that I've overlooked?
Upvotes: 1
Views: 102
Reputation: 195
Set ColorOrder
before the first call to plot()
.
C = [1 0 0; 1 0 0; 1 0 0; 1 0 0;...
0 1 1; 0 1 1;...
1 1 0; 1 1 0; 1 1 0; 1 1 0];
axes()
set(gca,'ColorOrder',C);
hold all
for k = 1:numFiles
plot(zonal{k}, deltaT{k},'*','MarkerSize',11);
end
hold off
plot()
will then examine the (fixed) value of ColorOrder
each time plot()
is called and iterate through its values.
Upvotes: 2