필터 지우기
필터 지우기

displaying time on plot

조회 수: 4 (최근 30일)
davit petraasya
davit petraasya 2016년 3월 20일
댓글: davit petraasya 2016년 3월 24일
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!

채택된 답변

Image Analyst
Image Analyst 2016년 3월 20일
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().
  댓글 수: 1
davit petraasya
davit petraasya 2016년 3월 24일
Thank Image Analyst. I thought there would be function just appears all points data at once. Well,Manually textbox also worked :).

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Star Strider
Star Strider 2016년 3월 20일
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
davit petraasya
davit petraasya 2016년 3월 24일
Thanks Star again for your concern!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by