%% Set Limits for y-Axis with Dates
% Create a horizontal bar chart with dates along the y-axis. Set the y-axis limits to range from June 1, 2014 to June 10, 2014.

t = datetime(2014,06,1) + caldays(0:20);
y = rand(21,1);
barh(t,y)

tstart = datetime(2014,06,1);
tend = datetime(2014,06,10);
ylim([tstart tend])

% Copyright 2012 The MathWorks, Inc.