Describe › Standalone plots

Contour plot (X, Y, Z surface)

A contour plot interpolates scattered (X, Y, Z) points onto a regular grid by Gaussian-kernel smoothing and draws iso-value lines — the 2-D map of a 3-D surface.

What is Contour plot (X, Y, Z surface)?

A contour plot shows a surface z = f(x, y) from above: each line traces a constant z, so closely-spaced lines mean a steep gradient and widely-spaced lines a gentle one. Because real data is sampled at irregular (x, y) locations, the surface is first estimated on a regular grid by Nadaraya-Watson kernel regression — each grid node is a Gaussian-distance-weighted average of the nearby points, which is smooth and avoids the bull's-eye artefacts of inverse-distance weighting.

Iso-lines are then extracted by the marching-squares algorithm. The smoothness control is the kernel bandwidth as a fraction of the data extent: too small and the surface is bumpy and over-fits noise, too large and real features wash out.

When should I use Contour plot (X, Y, Z surface)?

  • Response surfaces (yield over two process settings).
  • Spatial fields (a measurement over a map of x/y locations).
  • Any z sampled over two continuous predictors where you want to see ridges, peaks, and gradients.

What data does it need?

Three numeric columns — X, Y, and Z (height) — plus the number of contour levels and the smoothing bandwidth.

What does it report?

Colour-ramped contour lines (optionally shaded between) over the X–Y plane, with the original sample points overlaid and the Z range reported.

What does it assume?

  • The underlying surface is reasonably smooth at the chosen bandwidth.
  • Data covers the plotted region — contours far from any sample point are extrapolation and unreliable.
  • Interpolation is for visualisation, not inference; it doesn't model measurement error.

How do I interpret the result?

Tightly-packed contours mark steep gradients; concentric closed loops mark a peak or basin. Treat regions with no nearby sample points as unsupported.

See also