GNUPLOT command syntax

3

I have used GNUPLOT a few years from from my own software and I am increasingly impressed by its flexibility and power. One case I want to plot is several columns from a table generated by my software and earlier I used: plot '-' using 1:2 ..., '' using 1:3 .... with the table repeated afterwards as many times as I wanted columns plotted, each time separated with an e.

Recently I learned it is possible to write the table once and refer to it with a symbol using: plot for [i=2:3] $table using 1:i ...

Now I wanted to add scaling of the values and in the old format I could use: plot '-' using 1:(0.001*$2) ... '' using 1:(0.001*$3) ...

but I find it does not work to write: plot for [i=2:3] using 1:(0.001*$i) ...

Is there some workaround? I looked in the manual but it is rather terse.

Bo Sundman

Posted 2019-05-02T18:38:15.260

Reputation: 131

Answers

1

You can use the column accessor column(i) :

plot for [i=2:3] $table using 1:(0.001*column(i)) 

It does also work in functions.

Joce

Posted 2019-05-02T18:38:15.260

Reputation: 637