MATLAB: How to change axis to text format

axismonthtext;

How can I change x axis to months format
ex: Jan instead of 1, and Feb instead of 2

Best Answer

Use xticklables for eg:
x = linspace(0,12);
y = x.^2;
plot(x,y)
xticks([0:1:12])
xticklabels({'','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'})
Related Question