3D surface plot: picture a response over two factors

Updated

A 3D surface plot draws a response as a landscape over two variables: the two factors span the floor, the response is the height, and a shaded surface joins the heights over a grid. It gives an immediate feel for the shape of a relationship: a hill, a valley, a ridge or a saddle. It is most often used to picture a model fitted to a response surface design, alongside a contour plot that shows the same surface from above.

When to use it

  • You want a first, intuitive look at how a response depends on two factors at once.
  • You need to show non-specialists why the best setting is a region, a ridge or a corner, rather than a single point.
  • You want to see curvature and interaction together: a twisted or tilted surface means the factors interact.
  • You have measured values on a regular grid, such as heights across a part, and want to see their overall shape.

How it works

  1. Lay a grid over the two factors, for example 30 × 30 points across the tested range.
  2. Compute the response at each grid point, from the fitted equation or by interpolating measured data.
  3. Join neighboring points into small patches and shade them, usually with a color scale tied to height, so the eye can judge height from color as well as position.
  4. Project the result in perspective from a chosen viewing angle. A good tool lets you rotate the view.

A 3D wireframe plot is the same construction drawn as a mesh of lines without shading. With more than two factors, the plot holds the others at fixed values.

Example

A packaging engineer studies the seal strength of a pouch (N/15 mm) against jaw temperature (130 to 170 °C) and dwell time (0.4 to 1.2 s). With coded units x₁ = (temperature − 150) / 20 and x₂ = (dwell − 0.8) / 0.4, the model fitted to a central composite design is:

Strength = 18 + 3.0x₁ + 2.0x₂ − 2.5x₁² − 0.8x₂² − 1.6x₁x₂

The heights the surface is drawn through, on a coarse grid (N/15 mm):

Dwell \ Temperature130 °C140 °C150 °C160 °C170 °C
1.2 s15.317.919.219.318.1
1.0 s14.117.118.819.318.5
0.8 s12.515.918.018.918.5
0.6 s10.514.316.818.118.1
0.4 s8.112.315.216.917.3

Seen in 3D, the surface climbs steeply from the cold, short corner (130 °C and 0.4 s, 8.1 N/15 mm) and levels off into a long, almost flat ridge across the back. The model's highest point is 19.4 N/15 mm at 155.9 °C and 1.18 s, but the ridge matters more than the peak:

  • Along the ridge, strength barely changes: 19.2 at 150 °C and 1.2 s, 19.3 at 160 °C and 1.0 s, 19.0 at 165 °C and 0.95 s.
  • Across the ridge, it drops quickly. At 160 °C, cutting dwell from 1.0 to 0.4 s loses 2.4 N/15 mm; at 130 °C, the same cut loses 6.0.

The curvatures confirm the picture: in the direction along the ridge the surface bends only about one sixth as sharply as across it. Predicted strength is at least 19 N/15 mm over about 14% of the tested region, a band running from about 148 °C at 1.2 s to 165 °C at 0.85 s.

The practical message is a trade-off: the line can run hotter with a shorter dwell, and gain speed, with almost no loss in strength, as long as it stays on the ridge. The peak sits close to the 1.2 s edge of the region, so the engineer should not assume strength keeps rising with longer dwell beyond what was tested.

How to read the results

  • Overall shape first. Is it a dome, a bowl, a ridge, a saddle, or a tilted plane?
  • Where the surface is flat. Flat areas near the top are robust settings: small drifts in the factors barely move the response.
  • Where it is steep. Steep areas are sensitive; avoid running there.
  • Twist. If the slope along one factor changes with the other, the factors interact.
  • Exact numbers. Read them from a contour plot or the model, not from the 3D view.

Common mistakes

  • Trusting one viewing angle. A peak can hide a valley behind it. Rotate the plot, or check the contour plot.
  • Reading heights off the picture. Perspective makes the front look taller than the back. A 3D view is for shape, not for values.
  • Adding 3D to data that do not need it. Bar charts and pie charts drawn in 3D distort values and add nothing. Use 3D only when two continuous factors really define a surface.
  • Extrapolating the surface. The model is a local approximation; outside the tested region, the surface is a guess.
  • Forgetting the other factors. With more factors, the plot is one slice at fixed settings; say which.

Frequently asked questions

When should I use a 3D surface plot instead of a contour plot?

Use the surface plot to see and explain the overall shape; use the contour plot to read settings and values. They work best together.

What is the difference between a surface plot and a wireframe plot?

A surface plot shades the patches between grid lines; a wireframe plot shows only the grid lines. Wireframes let you see through the surface, but fine meshes get busy.

What does a ridge on a response surface mean?

That many combinations of the two factors give nearly the same response. You can choose among them on other grounds, such as cost or speed, which makes a ridge useful in practice.

Can I make a 3D surface plot from experimental data without a model?

Yes, by interpolating measured points onto a grid, but the surface between points is invented by the interpolation. A fitted model, checked for lack of fit, is a sounder basis.

Try it with your own data

StatLab SPC is free, open-source statistics for engineers. It runs in your browser, works offline, and never uploads your data.

Open StatLab