2014-07-18 56 views
1

我想繪製下面的公式f = x + y,其中x是來自一個文件的列,而y是來自不同文件的列。gnuplot:如何繪製多個文件的功能?

這可能嗎?我該怎麼做?

+0

這有幫助嗎? https://www.ma.utexas.edu/users/ktaliaferro/gnuplot_examples.html#2var –

+4

您必須先合併這兩個文件,然後才能執行此操作。 [從gnuplot中的2個文件獲取比率](http://stackoverflow.com/a/20070138/2604213)。 – Christoph

+1

[gnuplot中從2個文件中獲取比率]的可能重複(http://stackoverflow.com/questions/20069641/get-ratio-from-2-files-in-gnuplot) – Christoph

回答

1

粘貼文件:

paste file1 file2 > file3 

然後繪製它:

plot "file3" u 1:($2+$4) 

或完全內的gnuplot:

plot "< paste file1 file2" u 1:($2+$4) 

,我假設x是第二列file1和y是file2中的第二列:當粘貼時,它們將是第2列和4。