Newer
Older
datetick(hPlotAxes(1), 'x', 'keeplimits');
datetick(hPlotAxes(2), 'x', 'keeplimits');
datetick(hPlotAxes(3), 'x', 'keeplimits');
% Make the axes visible
% ---------------------
set(hPlotAxes(1), 'Visible', 'on' );
set(hPlotAxes(2), 'Visible', 'on' );
set(hPlotAxes(3), 'Visible', 'on' );
% The 3 axes will behave identically when zoomed and panned
% Since R2014b figure became an object, linkaxes failed if
% the 3 axes not defined
% ---------------------------------------------------------
if verLessThan('matlab','8.4')
linkaxes([hPlotAxes(1),hPlotAxes(2),hPlotAxes(3)], 'x');
else
if hPlotAxes(2).XLim(1) ~= 0 && hPlotAxes(3).XLim(1) ~= 0
linkaxes([hPlotAxes(1),hPlotAxes(2),hPlotAxes(3)], 'x');
end
end