%% Link Subplot Limits
% Load the count.dat data set which returns a three-column array named count. Create a figure with three subplots and return the Axes objects. In each subplot, create a bar graph.

load count.dat  
ax1 = subplot(3,1,1);
bar(count(:,1),'g');

ax2 = subplot(3,1,2);
bar(count(:,2),'b');

ax3 = subplot(3,1,3);
bar(count(:,3),'m');

%
% Link the x-axes and y-axes limits using linkaxes with the argument 'xy'. If you zoom in on one subplot, then the other two subplots behave in the same manner. To enable interactive zooming, use zoom on. To disable zooming, use zoom off

linkaxes([ax3,ax2,ax1],'xy'); 

% Copyright 2015 The MathWorks, Inc.