Correct input for list_plot3d(..., interpolation='spline')
I'm trying to construct smooth surfaces from lists of points in 3-space using list_plot3d
and the spline
option, but without success. For example, the input
list_plot3d ([(-1, 2, 3), (2, -1, 3), (3, -1, 2), (-1 ,3 ,2), (2, 3, -1), (3, 2, -1)], interpolation_type='spline')
returns the error
TypeError: m >= (kx+1)(ky+1) must hold
The following returns the expected piecewise linear surface suggesting that there is a special restriction on the input when using the spline
option.
list_plot3d ([(-1, 2, 3), (2, -1, 3), (3, -1, 2), (-1 ,3 ,2), (2, 3, -1), (3, 2, -1)])
Question: What is the correct input to obtain a best fit polynomial surface going through the six points in $\mathbb{R}^3$?
Edit: As pointed out by @slelievre, since these six points lie in a common plane, the corresponding surface should be the plane containing the points. So why does Sage
throw an error instead of this plane?
Maybe interpolation type 'spline' wants the x and y coordinates of the points to form a nice grid, and here, because we have six points not forming such a grid, it is not happy?
Here's an example (if I understand correctly) of some points having 'nice' x and y coordinates: pts=[(0,0,1),(1,0,2),(0,1,2),(1,1,5)]. Using pts instead of the six points given in the post yields the same TypeError. Can you get a smooth surface from any point set? A single functioning example would be of great help. But I guess I'm off to read the source code: /scipy/interpolate//_fitpack_impl.pyc