3

I have a data series that I'm trying to plot in Gnuplot of the format:

x1, y1, x2, y2 ... xn, yn

Where every two adjacent columns represent an xy pair. I'm looking for a way to plot each of these xy pairs as separate lines using a single (concise-ish) command in Gnuplot, rather than trying a command like this:

plot "file" u 1:2 w l, "file" u 3:4 w l

...and so on.

Excellll
  • 12,717

1 Answers1

2

You can use a for loop in (relatively recent) gnuplot:

plot for [i=1:4] "file" u (column(2*i-1)):(column(2*i)) w lp

will plot four curves, each based on one of the first four pairs of each line in the file.

Joce
  • 1,040