2013-12-09 39 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