how to change axis to text format
1 view (last 30 days)
Show older comments
Ibrahim AlZoubi
on 3 May 2020
Commented: Ibrahim AlZoubi
on 3 May 2020
How can I change x axis to months format
ex: Jan instead of 1, and Feb instead of 2![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/289942/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/289942/image.png)
9 Comments
Accepted Answer
Ajay Kumar
on 3 May 2020
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'})
5 Comments
More Answers (0)
See Also
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!