I have data of the form {{x1, y1, f(x1, y1}, {x2, y2, f(x2, y2)}, ...}
.
I need to interpolate the data to get an interpolated f(x, y)
.
When I just do Interpolation[data]
, I get a function, but the result is not very smooth, independent on the interpolation order (there is a difference between the orders, but it does not get better).
When I plot the data with ListPlot3D[data]
, I get a really nice result. It is really smooth. When I change the interpolation order in ListPlot3D
, the result does seem to not change, except when going from 0th order to 1st order.
So I would like to get a function, which looks like the result of ListPlot3D
. How does ListPlot3D
interpolate the data? Or can I get a function of the ListPlot3D
result?
Edit
First of all, thanks a lot for the detailed answers. I just tried the InterpolationPolynomial
, but it turned out that it is too demanding for our machine. Maybe, if I post two pictures showing what I'm seeing, one of you will show me how to interpolate my data in the proper way.
First the plot made with ListPlot3D
, the nice one:
And the interpolated function plotted:
My data grid has the resolution of 0.2, so I have 101 x 101 data points; that is, the grid is based on {x, -10, 10, .2}, {y, -10, 10, .2}
).
As one can clearly see, the second plot shows some edges and is not as smooth as the first one. Maybe someone has an idea?
Interpolation[data, InterpolationOrder -> All]
- for unstructured grids it may help. $\endgroup$Plot3D
is simply using a coarser mesh thanListPlot3D
. To get similar results you could tellPlot3D
to use a similar mesh with the optionsPlotPoints -> 100, MaxRecursion -> 0
$\endgroup$