1

I have the following data sets:

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

and

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 have plotted both with the following command:

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

I would like to calculate the difference and the deviation between these two splines. Is this possible in gnuplot?

Vlad Chalapco
  • 41
  • 1
  • 3

1 Answers1

1

Here is a solution using 2 tabular files and paste external shell command:

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'
bibi
  • 3,671
  • 5
  • 34
  • 50