How to remove 'year' in the x-axis
Show older comments
Hi, I used the following command to make a plot. I don't wan to show the "year", but I got this plot. The x format is "datetime".

plot(x,y,'DateTimeTickFormat','MM/dd HH:mm')
Accepted Answer
More Answers (1)
Abby Skofield
on 20 Sep 2023
Moved: Adam Danz
on 17 Oct 2023
Starting in MATLAB R2023b, you can add, remove, or update the secondary labels using the new functions xsecondarylabel, ysecondarylabel, zsecondarylabel.
t=datetime(2019,1,1,0,0:15:365*24*60-15,0);
plot(t,cumsum(randn(size(t))))
title('2019')
xsecondarylabel(Visible='off')
Categories
Find more on 2-D and 3-D Plots 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!

