2
votes

I have been trying to plot two vectors using this command with Gnuplot:

gnuplot> plot "test.dat" u 1:2:3:4 w vec    
gnuplot> replot "test.dat" u 3:4:5:6 w vec

test.dat

0.000000       0.000000     1.57073177E-02  0.999876618      0.547507644      0.991522372 

But, Gnuplot plots last coordinate (0.991522372) from the second command (replot command) by adding 1 to it.

So for the replot command, it draws a line from 1.57073177E-02, 0.999876618 to 0.547507644, 1 + 0.991522372

Can anyone help me to solve this problem?

1
I wish I could add the image of mu plot, but my current reputation level doesn't allow me to do so. - Gihan

1 Answers

0
votes

The third and fourth values for the vector plotting style are relative coordinates. So, in general, you must use

set style data vector
plot "test.dat" u 1:2:($3-$1):($4-$2), "" u 3:4:($5-$3):($6-$4)