2013-01-24 24 views
0

我是Gnuplot的with vectors選項的快樂用戶。但是,在大多數情況下,矢量需要重新調整以創建一個漂亮的圖形。在Gnuplot中調整矢量的簡單方法?

目前,我被

plot "data" using 1:2:($3*scale):($4*scale) with vectors 

理想的情況下這樣做,我只是想跳過using和寫作向量長度規模手動一次,這樣,我可以用

plot "data" with vectors scale 0.1 

也許有一個我不知道的自動縮放選項?

回答

2

據我所知,沒有捷徑。你可能做的最好的就是使用宏:

set macros 
with_vectors = "using 1:2:($3*scale):($4*scale) w vectors" 
scale = 0.1 
plot "data" @with_vectors 
scale = 0.2 
plot "data" @with_vectors 
+0

當gnuplot被加載時,這些宏是否可以設置? – Bernhard

+1

你可以把它放在'.gnuplot'文件中。這適用於交互式腳本 - 我不確定它是否適用於「批處理」腳本,儘管...查看文檔('help startup'),似乎暗示它會以任何方式加載 – mgilson