Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Labelling graphs/images with text() function

  1. Mar 3, 2009 #1
    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 (Text):

    for i=1:400
        text(x_pos(i),y_pos(i),i)
    end
     
    What else can i try? Thanks!
     
  2. jcsd
  3. Mar 3, 2009 #2

    f95toli

    User Avatar
    Science Advisor
    Gold Member

    You could just convert the number to a string using the num2str function.
    Look it up in the help.
     
  4. Mar 3, 2009 #3
    thnx f95toli this works!
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Labelling graphs/images with text() function
Loading...