View Full Version : Gnuplot


Omar Usman
10-14-2010, 08:49 AM
Anybody used GNUPlot?

If I have some data of following format which shows 5 columns in file "test"

1 2 3 4 5
5 4 3 2 1

I can plot column 3 against 1 in gnuplot by giving:

plot "test" using 1:3

If I want to plot square of column 3 I will use:

plot "test" using 1: ($3*3) ... without the space after 1:

Now if I am to prepare shell script for this, $3 will refer to the third argument being passed to the script and not to column 3 ....

Anybody knows how to do this?

Miakhel
10-14-2010, 09:58 AM
Wait for moderators they will be help you
manana

roadrunner
10-14-2010, 11:31 AM
Anybody used GNUPlot?

If I have some data of following format which shows 5 columns in file "test"

1 2 3 4 5
5 4 3 2 1

I can plot column 3 against 1 in gnuplot by giving:

plot "test" using 1:3

If I want to plot square of column 3 I will use:

plot "test" using 1: ($3*3) ... without the space after 1:

Now if I am to prepare shell script for this, $3 will refer to the third argument being passed to the script and not to column 3 ....

Anybody knows how to do this?

I don't use it.

It should be $3^2 though.

Why will your $3 change if you run it from a shell?

Just run it with the gnuplot command.