How can I write titles on scatter plot?

Hello MATLAB Gurus! I have a Gui and axes1 to make scatter plot on it. Well I did it but I want to assign names to points on the graph. Any idea would be a great job for me. Thanks in advance.
a=[1,2,3,4];
b=[5,6,7,8];
names={'a','b','c', 'd'};
scatter(handles.axes2, a, b, 'filled')

댓글 수: 2

@Johannes
@Johannes 2015년 9월 17일
Hi, you can use the Text function to add names to the data points.
Bye, john
Giorgi
Giorgi 2015년 9월 17일
편집: Giorgi 2015년 9월 17일
Well i used text but it did not work in GUI axes :( Any other ideas?

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

답변 (1개)

Walter Roberson
Walter Roberson 2015년 9월 17일

0 개 추천

See text() or annotation()
If you were to plot only one point at a time, you could use legend()

댓글 수: 3

Giorgi
Giorgi 2015년 9월 17일
Thanks for commenting first :) Well those works on simple scatter when it not in GUI axes but in GUI axes it does not work any other ideas?
text(handles.axes2, a(1), b(1), names{1});
Giorgi
Giorgi 2015년 9월 17일
Well I did exactly how you wrote but it did not work in axes again but when I wrote it in command window it works. Any other idea?

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

카테고리

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

질문:

2015년 9월 17일

댓글:

2015년 9월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by