Labelling graphs/images with text() function

  • Thread starter nyxynyx
  • Start date
Hi, I'm plotting some circles in a 20x20 arrangement using the rectangle tool and I have to label each of the circle a number from 1 to 400. However, the following code does not do what i once, since i think i can only label with strings and not running numbers...

Code:
for i=1:400
    text(x_pos(i),y_pos(i),i)
end
What else can i try? Thanks!
 

f95toli

Science Advisor
Gold Member
2,925
418
You could just convert the number to a string using the num2str function.
Look it up in the help.
 
thnx f95toli this works!
 

Related Threads for: Labelling graphs/images with text() function

Replies
1
Views
667
  • Posted
Replies
2
Views
520
  • Posted
Replies
2
Views
487
Replies
2
Views
3K

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving
Top