17
votes

I have a data file containing 30 columns and N rows. Each rows correspond to 30 values of function f(x) for x={1,...,30}. The data file has following pattern:

#<index> f(1) f(2) ... f(30)
1 7.221 5.302 ... -1.031
2 4.527 3.193 ... 0.410
...
N 6.386 1.321 ... -0.386

gnuplot interprets first column as X and the second one as Y. But, what I want is to plot each line in a separated output file without transposing this data file. For example, for the first line, the desired output would be what gnuplot gets with this input file:

# X Y
1 7.221
2 5.302
...
30 -1.031
2

2 Answers

7
votes

UPDATED based on @Christoph's comment:

plot for [i=2:30] 'data.dat' using (i-1):(column(i)) with linespoint
10
votes

I found a solution:

plot "data.dat" matrix every 1::1 with linespoint
  • matix indicates data file type by which the input file interpreted as matrix.
  • every 1::1 skip the first column