displaying time on plot
Show older comments
Hi Does anyone know how to display points time on plot? I have 15 points(15 x and 15 y) and 15 different years(1980,1982,1983,...) corresponding to the points. I can plot the point like plot(x,y,'.r').How I may display the years of each point on plot?
Thanks a lot!
Accepted Answer
More Answers (1)
Star Strider
on 20 Mar 2016
If you want to display all the years on the x-axis, use the set function:
For example:
x = [1980 1982 1983 1986 1987];
y = rand(1, 5);
figure(1)
plot(x, y)
set(gca, 'XTick',x)
grid
1 Comment
davit petraasya
on 24 Mar 2016
Categories
Find more on Annotations 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!