2014-10-19 23 views
2

我打算繪製多列數據文件。繪製第一列和第i列的xy圖。所以基於手冊的作品的命令。哪個gnuplot版本開始有這樣的功能?我的機器安裝版本4.2,但無法工作。對於columnheader()
相同的問題我想確保它是我的代碼的問題或版本的問題。gnuplot:for和columnheader命令

+0

從4.4開始,我認爲'plot for ...'是可用的,並且自4.6開始可以使用更強大的'{...}'。 – Miguel 2014-10-19 08:55:28

+0

@Miguel我不一定會說'do for'更強大,因爲在這種情況下你必須使用'plot for';} – Christoph 2014-10-19 09:08:17

回答

6

版本4.2已具有columnheader功能。

考慮其中包含

first second third fourth 
1 2 3 4 
2 3 4 5 
3 4 5 6 

在gnuplot的4.2數據文件data.txt可以使用例如

set key autotitle columnheader 
set style data lines 
plot 'data.txt' using 1:2, '' using 1:3, '' using 1:4 

從版本4.4可以使用迭代plot命令裏面:

set key autotitle columnheader 
set style data lines 
plot for [i=2:4] 'data.txt' using 1:i 

除了使用set key autotitle columnheader的你也可以用title columnheadertitle columnheader(i+1)如果標題欄沒有給出列匹配using聲明。這至少從4.2開始起作用。

+0

好的,謝謝。我會查一下。 – 2014-10-20 01:13:38