%% Specify Colors Using Default Color Order
% Specify the colors for a chart with two y-axes by changing the default axes color order.
% Create a figure. Define two RGB color values, one for the left side and one for the right side. Change the default axes color order to these two colors before creating the axes. Set the default value at the figure level so that the new colors affect only axes that are children of the figure fig. The new colors do not affect axes in other figures. Then create the chart.

fig = figure;
left_color = [.5 .5 0];
right_color = [0 .5 .5];
set(fig,'defaultAxesColorOrder',[left_color; right_color]);

y = [1 2 3; 4 5 6];
yyaxis left
plot(y)

z = [6 5 4; 3 2 1];
yyaxis right
plot(z)

% Copyright 2012 The MathWorks, Inc.