Is it possible to show point id in figure

When we imported the data in Matlab as matrix with (point id, x,y) data is include coordinates. How to show point id's in figure? is that possible? thanks

댓글 수: 3

Mahdi
Mahdi 2013년 4월 2일
편집: Mahdi 2013년 4월 2일
Do you mean that you want to label the points with the string "Point id"?
abuzer
abuzer 2013년 4월 2일
Dear Mahdi, Thank you so much. I found the solution by your answer :). a = pointid ; b = num2str(a); c = cellstr(b); dx = 0.1; dy = 0.1; % displacement so the text does not overlay the data points text(x1+dx, y1+dy, c);
Mahdi
Mahdi 2013년 4월 2일
Glad I was of help :) Please "accept" the answer so that other contributors don't look at the post.

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

 채택된 답변

Mahdi
Mahdi 2013년 4월 2일

0 개 추천

hold on
% Get the values from the matrix
point_id=Matrix1(:,1);
x=Matrix1(:,2);
y=Matrix1(:,3);
% Set the text to show up
for i=1:length(x)
text(x(i),y(i), point_id)
end
Note that you can also do this without redefining the values again. I just did it for clarity.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

질문:

2013년 4월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by