1

我有以下数据集:

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

我已经使用以下命令绘制了两者:

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

我想计算这两条样条线之间的差异和偏差。这在gnuplot中可能吗?

4

1 回答 1

1

这是使用 2 个表格文件和paste外部 shell 命令的解决方案:

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'
于 2016-04-02T13:54:57.020 回答