MATLAB: How to match the datetick

datetickx axis

Hi all,
I've attached the plot that I want to correct the datetick (it doesn't match with the real date). Could anyone help, please?
thanks in advance.

Best Answer

h = openfig('AugWnd.fig');
ax = get(h,'CurrentAxes');
ax.XAxis.TickLabels = cellstr(datestr(ax.XAxis.TickValues/24 + datenum('2017-08-01'),'dd-mmm'));
Note that the ticks are 100 hours apart. You might want to consider changing ax.XAxis.TickValues to [0:96:799, 800] to get every 4 days plus the end point.
Related Question