2016-04-02 17 views
1

差との偏差を計算I持って、次のデータセット:gnuplotの2つの補間

1 3 
2 4 
3 2 
4 10 
5 9 
6 8 
7 6 
8 2 
9 1 
10 0.5 

0.1 8 
1.2 8 
2.1 7 
3.4 6 
4.3 6 
5.2 7 
4.5 5 
6.4 8 
7.2 4 
8.2 3 
9.1 2 

Iは、次のコマンドの両方をプロットした:

plot 'data1' using 1:2 lc rgb 'blue' smooth csplines title 'data1', 'data2' using 1:2 lc rgb 'green' smooth csplines title 'data2'

差分を計算したいと思いますこれらの2つのスプラインの間の偏差。これはgnuplotで可能ですか?ここで

答えて

1

は2つの表形式のファイルとpaste外部シェルコマンドを使用してソリューションです:

set xrange [0:9] 
set table 'data1.dat' 
plot 'data1' using 1:2 smooth csplines title 'data1' 
unset table 
set table 'data2.dat' 
plot 'data2' using 1:2 smooth csplines 
unset table 
plot 'data1' using 1:2 lc rgb 'blue' smooth csplines title 'data1',\ 
    'data2' using 1:2 lc rgb 'green' smooth csplines title 'data2',\ 
    '<paste data1.dat data2.dat' u 1:($5-$2) w l lc rgb 'magenta' title 'data2-data1'