MATLAB: Displaying time on plot

display timeon plot

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!

Best Answer

Use the text() function. There are a number of date and time functions that you might want to use in conjunction with sprintf() to create a string to display on your graph at some (x,y) location with text().