there is also optimize.curve_fit as wrapper for least_sq
I thought this would only work with y = f(x)? Will try!
your error function returns 2d instead of 1d
you need one ravel
return np.ravel(p0 + p1*x + p2*y - f)
Thank you very much, that's it! Works nicely!