Skip to content

surfl

3D surface plot with lighting.

h = surfl(X, Y, Z, ...)

Renders a surface with simulated lighting from a directional source. Surface is shaded based on its normal directions relative to the light. Useful for emphasizing 3D structure when colormap-based shading isn’t enough.

surfl(peaks(50))
  • surf — 3D surface plot with colored faces.
  • light — Add a directional or point light source to a 3D scene.
  • lightangle — Add or position a light source by azimuth and elevation.