%% Control Colors for Each Side
% Specify the color scheme for each side of the axes by setting the color order to the two colors that you want to use. Starting in R2019b, you can use the colororder function to set the color order. Then, plot two lines against the left y-axis and two lines against the right y-axis. Add a legend.

colororder({'b','m'})

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

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

% Copyright 2019 The MathWorks, Inc.