I have 2 sets of data file
#veff S Pmax S Pmin
0.10 103 0.2135 152 -0.0505
0.11 104 0.2162 152 -0.0592
0.12 105 0.2177 152 -0.0669
and
#veff S Pmax S Pmin
0.13 106 0.2177 152 -0.0729
0.14 105 0.2162 152 -0.0778
0.15 105 0.2127 152 -0.0819
0.16 105 0.2078 152 -0.0858
0.17 105 0.2018 153 -0.0879
0.18 104 0.1959 153 -0.0889
0.19 104 0.1907 153 -0.0898
0.20 103 0.1860 153 -0.0921
while I try to fit the fit goes beyond the points with the code
set terminal wxt
#set term postscript eps color enhanced
#set output "1.eps"
set xlabel "Pmax"
set ylabel "Pmin"
[![enter image description here][1]][1]
set title "Pmax vs Pmin"
unset key
FIT_LIMIT = 1e-6
f1(x)=a1*x*x+b1*x+c1
f2(x)=a2*x*x+b2*x+c2
fit [x=0.185:0.218] f1(x) "PmaxPminVEFF.txt" u 3:5 via a1,b1,c1
fit [x=0.212:0.218] f2(x) "PmaxPminVEFF1.txt" u 3:5 via a2,b2,c2
plot 'PmaxPminVEFF.txt' using 3:5 with p pt 7,f1(x) lc rgb "red",\
'PmaxPminVEFF1.txt' using 3:5 with p pt 8, f2(x) lc rgb "green"
the fitting line goes beyond the points. Help me out here to fix the fittings up to the point only. Fit command is also not working.
Check the following:
Code:
Result: