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

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

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

linkaxes([ax1,ax2],'x');

%
% Set the x-axis limits for the second subplot. Changing the x-axis limits effects both subplots.

ax2.XLim = [4.5,9.5];

% If you pan either subplot, then both subplots pan uniformly in the x-direction, but only one subplot moves in the y-direction. To enable interactive panning, use pan on. To disable panning, use pan off.
% Copyright 2015 The MathWorks, Inc.