%% Control Individual Plot Colors
% Control individual plot colors by setting the color order for each side of the axes.
% Plot three bar charts against the left side. Use a different color for each bar series by setting the color order for the left side to the default color order.

yyaxis left
bar(magic(3));
colororder('default')

% Plot three scatter plots against the right side. Use a different color for each scatter plot by setting the color order to an array of color names. Alternatively, you can specify the colors using a matrix of RBG triplets. Then add a legend.

yyaxis right
scatter([1 2 3],[2 5 2],'filled')
hold on
scatter([1 2 3],[3 4 1],'filled')
scatter([1 2 3],[4 2 4],'filled')
hold off
colororder({'r','b','c'})
legend

% Copyright 2019 The MathWorks, Inc.