%% Change Axes Properties
% Modify properties of a chart with two y-axes by setting Axes properties.
% Create a chart with two y-axes and plot data.

x = [1 2 3];
y1 = [2 6 4; 3 5 4; 5 7 8];
y2 = 100*[5 5 3; 3 4 7; 5 6 3];
figure
yyaxis left
plot(x,y1)
yyaxis right
plot(x,y2)

%
% Reverse the direction of increasing values along each y-axis. Use yyaxis left to activate the left side and set the direction for the left y-axis. Similarly, use yyaxis right to activate the right side. Then, set the direction for the right y-axis.

ax = gca;
yyaxis left
ax.YDir = 'reverse';
yyaxis right
ax.YDir = 'reverse';

% Copyright 2012 The MathWorks, Inc.