Add numbers in a plot

조회 수: 78 (최근 30일)
evangeline
evangeline 2018년 3월 2일
댓글: Jorge Castillo 2020년 4월 21일
I have 10 points with x and y coordinates, and I am plotting circles that center in these coordinates. I need to add the numbers 1 to 20 on each circle. How can I do this? So each circle has a number on it in my figure. x=[3,5,8,6,1,2,4,5,7,9] y=[5,4,3,1,7,8,6,5,9,0] so I will have 10 circles.
  댓글 수: 2
Jan
Jan 2018년 3월 2일
편집: Jan 2018년 3월 2일
What does "circles that center in these coordinates" mean?
What do you expect as result of "adding 20 to a circle"? A circle is a geometric object, but 20 is a number.
How can a circle have a number on it? Do you want to insert text labels to the lines, e.g. as in contour plots (link)?
Please edit the question and try to be more clear.
Jorge Castillo
Jorge Castillo 2020년 4월 21일
Old Comment, but really dude ^.... it's not too difficult to comprehend...

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

답변 (1개)

KL
KL 2018년 3월 2일
Assuming you know how to plot circles, you could use text command right after you plot the circle,
text(x,y,['(',num2str(x),',',num2str(y),')']) %for ex: x = 3, y = 5 (scalars)

카테고리

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