I have a data file like in four columns representing x1, y1, x2, y2.
e.g
1 2 3 4
2 3 4 5
3 4 5 6
4 5 6 7
etc.
Now I want to plot line segments using (x1,y1) and (x2,y2) as end points of the line segments. Thus I shall get 4 line segments from the above data file.
How can I achieve this using gnuplot ?
You can simply do
dataf = 'yourfilename.dat'
plot dataf using 1:2:($3-$1):($4-$2) with vectors nohead
without changing your original data file.
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