I have file with two columns like:
1.2, 3.4
5.6, 7.8
...
I want gnuplot to plot both columns in one coordinate system like it would, if there was only one column. Meaning: X-axis shows the line numbers, y-axis the values.
Example: The first two points of the two lines are (0, 1.2)
and (0, 3.4)
; the second points (1, 5.6)
and (1, 7.8)
.
I do not want the two columns being treated as x and y values, like it would if just go for plot "data.txt"
.
You can use the zero pseudo column which holds the current sample number. From help pseudocolumns
:
column(0)
The sequential order of each point within a data set.
The counter starts at 0 and is reset by two sequential blank
For example:
plot 'data.txt' using 0:1, '' using 0:2
The empty ''
uses the same data-source as the previous plot.
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