I have a file which have 18 columns. Using gnuplot, I want to plot them in this way: 1:2, 3:4, 5:6, ..., 17:18.
I have been trying with a do loop, but I don't know how to include the running index in the loop in the number of the colums. I tried something like that:
for [i=1:18] plot "numbers.dat" using (2*(i-1)+1):(2*(i-1)+2)
Thanks
To have the result of an arithmetical expression used as column index, use the column function:
plot for [i=1:18] "numbers.dat" using (column(2*(i-1)+1)):(column(2*i))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With