MATLAB: Multi-Line Colors in 2014

colorMATLABplot

In 2013 and earlier I could do this to compare multi-line plots:
% make up some data
X1 = rand(5,3);
X2 = X1+rand(5,3)*0.1;
plot(X1); % draw dataset 1
hold on;
plot(X2,':'); % compare with corresponding dataset 2
hold off;
This is broken in matlab 2014: the second set of lines colours don't match up with the first set.
I guess this is because the axes keep track of the colororder index when hold is on.
How can I reset the colororder index so that subsequent plots restart with color 1, as in previous matlabs? I'd really rather not have to go through a for loop to draw each of the lines!

Best Answer

Thanks all for your help. For anyone who wants to do this in future:
I finally got the answer by email from Claudette at Mathworks Documentation.
set(gca,'ColorOrderIndex',1)
will reset the colour order, so subsequent plot calls will use the same colour set.
So:
% make up some data
X1 = rand(5,3);
X2 = X1+rand(5,3)*0.1;
plot(X1); % draw dataset 1
hold on;
set(gca,'ColorOrderIndex',1)
plot(X2,':'); % compare with corresponding dataset 2
hold off;
will produce comparable solid and dotted lines.