%% Change Ruler Properties
% Modify properties of a chart with two y-axes by setting ruler 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 by setting properties of the ruler object associated with each axis. Use ax.YAxis(1) to refer to the ruler for the left side and ax.YAxis(2) to refer to the ruler for the right side.

ax = gca;
ax.YAxis(1).Direction = 'reverse';
ax.YAxis(2).Direction = 'reverse';

% Copyright 2012 The MathWorks, Inc.