Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

plot dataFile with points replaced with serial number of the data entry

148 views
Skip to first unread message

awim...@gmail.com

unread,
Apr 1, 2009, 7:24:03 PM4/1/09
to
that is a confusing header so i will explain what i want to achieve.

contents of file.dat

1 2
2 3
4 9
1 9

now i want to plot the data file but instead of points or circles or
stars showing at those co-ordinates i want to print the serial number
of the points as they appear in the file.
for example at the co-ordinate (1,2) i want to output a "1" in the
plot and at the co-ordinate (1,9) i want to output a "4" in the plot.

in matlab the corresponding command is

text(x,y,"blahblah");

i tried to tinker around in gnuplot using the set label command

set label "1" at 1,2

but that command by itself does not show the 1 immediately.

any help in this regard please ...

sfeam

unread,
Apr 1, 2009, 8:01:38 PM4/1/09
to
awim...@gmail.com wrote:

> that is a confusing header so i will explain what i want to achieve.
>
> contents of file.dat
>
> 1 2
> 2 3
> 4 9
> 1 9
>
> now i want to plot the data file but instead of points or circles or
> stars showing at those co-ordinates i want to print the serial number
> of the points as they appear in the file.
> for example at the co-ordinate (1,2) i want to output a "1" in the
> plot and at the co-ordinate (1,9) i want to output a "4" in the plot.


plot 'file.dat' using 1:2:(sprintf("%d",column(0))) with labels

awim...@gmail.com

unread,
Apr 1, 2009, 9:10:24 PM4/1/09
to
On Apr 2, 5:01 am, sfeam <sf...@users.sourceforge.net> wrote:
>
>     plot 'file.dat' using 1:2:(sprintf("%d",column(0))) with labels
>

wow ... you are a god sent help :D thanks so so much for this

0 new messages