No BSD License  

Highlights from
chcolor

from chcolor by Juha Koivisto
change each curve to different (brgcmk) color

chcolor()
function [] = chcolor()
% changes the colors of the 2d-graphs in current axis (~figure).
% Colors are taken from brgcmk (note: no yellow) order 
% and looped over and over.
% TODO:
% - add custom colors (colormaps perhaps) to parameters (nargin etc)
% - add custom axis to parameters (nargin etc)
% - add: if hasValue(Color); then change; else nothing

% get current axis
axisToHandle = gca;

% colors to use
colorsToUse = 'brgcmk';

% get the graphs (= lines, curves, etc)
graphs = get(axisToHandle,'Children');

% loop it through
for i = 1:length(graphs);
    set(graphs(i), 'color', colorsToUse(mod(i,6)+1))
end


Contact us at files@mathworks.com