2011-04-16 43 views

回答

1

AFAIK這是不可能的。 Gnuplot可以做某種算術,但不是這種算法。您可以調整將這種數據格式導出爲gnuplot可以處理的內容的程序,也可以編寫一個爲您執行相同技巧的小腳本。

如果我的理解是否正確這個python腳本應該做的數據轉換成一些gnuplot的可以處理:

#data = <read your data file> 
Content = data.split("\n") 
Dict = dict() 
for l in Content: 
    Line = l.split(" ") 
    if not Line[0] in Dict: 
     Dict[Line[0]] = int(Line[1]) 
    else: 
     Dict[Line[0]] += int(Line[1]) 

file = open("Output.data", "w") 
for (key, value) in Dict.items(): 
    file.write(key + " " + str(value) + "\n") 
file.close() 
+0

感謝確認我的假設和腳本。我已經有一些過程來做同樣的事情,但我希望有人會指出我在文檔中錯過的東西:) – nix 2011-04-19 16:53:57

相關問題