I much prefer the zooming behavior of plots created using datetime values to that seen when you plot timeseries data that uses the TimeInfo.StartDate feature. The sample code below illustrates the two approaches. When I zoom in, the bottom axis that uses datetime is much smarter about how times are displayed, offsetting year, month and day to the lower right-hand corner when appropriate.
I have a Simulink model that generates output using timeseries objects and would like the plot method on these objects to have behavior that matches datetime.
I've looked at the properties of each axis but cannot find any significant differences between them. Any suggestions on how to make this happen would be appreciated.
datesDatenum = (737342:(1/1440):737362)';
times_sec = (datesDatenum - datesDatenum(1))*86400;
values = sind(1:numel(datesDatenum))';
valuesTs = timeseries(values, times_sec);
valuesTs.TimeInfo.StartDate = datestr(datesDatenum(1));
valuesTs.TimeInfo.Units = 'seconds';
times_dt = datetime(datesDatenum,'ConvertFrom','datenum');
h(1) = subplot(2,1,1);
plot(valuesTs); grid on
h(2) = subplot(2,1,2);
plot(times_dt, values);grid on