If I have a data file with 4 columns:
x1, y1, x2, y2,
How can plot a line connecting (x1, y1)
to (x2, y2)
for each element (row)?
I assume it is pretty easy, but I have been playing around for an hour unsuccessfully.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityplot "DATA" using 1:2:($3-$1):($4-$2) with vectors nohead
The vectors style reads four columns (x, y, dx, dy) and draws a vector from (x, y) to (x + dx, y + dy).
nohead
prevents gnuplot from drawing the arrow head.