Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
plot "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.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .