COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### plot a graphic and identify each point with a label

• Email
• Follow

```Hi,
Example: I have 2 vectors (x,y) with size 10. I`d like to plot the graphic and identify each point with labels 1,...,10.
How can I do that?
Regards.
Douglas.
```
 0

See related articles to this posting

```Douglas <douglas.miranda@gmail.com> wrote in message <1903058366.131769.1290510051858.JavaMail.root@gallium.mathforum.org>...
> Hi,
> Example: I have 2 vectors (x,y) with size 10. I`d like to plot the graphic and identify each point with labels 1,...,10.
> How can I do that?
> Regards.
> Douglas.

Hi Douglas:

You probably want the "text(...)" function.  See here:
http://www.mathworks.com/help/techdoc/creating_plots/f0-4741.html#f0-19466

http://www.mathworks.com/help/techdoc/creating_plots/f0-41699.html#f0-41881

Note that the text( ) function places text in "graph space", which means that the text stays positioned relative to the data points when you do things like change the limits of the axes etc.

-- Graham
```
 0

```On 23/11/10 5:00 AM, Douglas wrote:

> Example: I have 2 vectors (x,y) with size 10. I`d like to plot the graphic and identify each point with labels 1,...,10.
> How can I do that?

Loop over the (x,y) pairs, text() the appropriate label at each pair.

```
 0