MATLAB: How to hide representative duration at datetime X-axis plot datetimeMATLABxaxisformat How to remove/hide representative duration at datetime X-axis plot under auto-mode condition(XTickLabelMode)? Best Answer You can do it by running the following statements.ax = gca;ax.XTickLabel = ax.XTickLabel;orax = gca;ax.XTickLabelMode = 'manual'; Related SolutionsMATLAB: Is there a way to get the values associated with the *minor* tick marks ax = gca;get(ax.XAxis, 'MinorTickValues')For R2014b and later, following also workax = gca;ax.XAxis.MinorTickValues MATLAB: Change the x axis labels in plot. This code shows an examplex = rand(1, 8760); % your vectort = datetime(2019,1,1,0,0,0):hours(1):datetime(2019,12,31,23,0,0); % 2019 is used because 2020 is leap yearax = axes();hold(ax);plot(t, x)ax.XTickLabelMode = 'manual';ax.XTick = datetime(2019,1,1,0,0,0):calmonths(1):datetime(2019,12,31,23,0,0);ax.XTickLabel = datestr(ax.XTick,'mmm'); Related QuestionHow to call a function within ax=gca formatModify axis tick frequency
Best Answer