First, some data is constructed and noise is then added to the z-component.
The view from above shows the irregular spacing of the x-y components of the data.
A fitting order of 0 produces a form of weighted moving average.
Linear or quadratic fitting, with a fitting order of 1 or 2 respectively, produce smoother plots.