2013-12-09 37 views
0

我的数据文件是这样的:加入箭头和标注点

x1 y1 x2 y2 id1 id2 value 

x1 y1 x2 y2 id1 id2 value 

x1 y1 x2 y2 id1 id2 value 
. 
. 
. 

我想联合两点(x1,y1)(x2,y2)用一个箭头从1到2

此外,我想:

添加点附近1“ID1”和点附近2“ID2”

箭头的中间增加一个标签有值。

回答

1

使用vectors绘图样式的箭头和label添加的所有标签:

plot 'data.txt' using 1:2:($3-$1):($4-$2) with vectors t '', \ 
    '' using 1:2:5 with labels offset char 0,1 t '',\ 
    '' using 3:4:6 with labels offset char 0,1 t '',\ 
    '' using (0.5*($1+$3)):(0.5*($2+$4)):7 with labels offset char 0,1 t '' 

绘制with vectors要求起点的箭头长度,$1访问进行计算的第一列的值,($3-$1)是箭头的x长度。 offset char 0,1将标签放置在给定点上方一个字符高度的垂直偏移处。欲了解更多帮助,请参阅help vectorshelp labels