From examples in the documentation:
Examples:
f(x) = a*x**2 + b*x + c
g(x,y) = a*x**2 + b*y**2 + c*x*y
FIT_LIMIT = 1e-6
fit f(x) 'measured.dat' via 'start.par'
fit f(x) 'measured.dat' using 3:($7-5) via 'start.par'
fit f(x) './data/trash.dat' using 1:2:3 via a, b, c
fit g(x,y) 'surface.dat' using 1:2:3:(1) via a, b, c
I would expect your script to work if you simply did:
set term png
set output 'test.png'
f(h,T) = a * h * (1 + alpha * T) + f0
fit f(x,y) 'data.txt' using 2:4:1:(1) via a, f0
set view 90,0 #possibly `set view 0,90` or `set view map`?
splot f(x,y)