Skip to content

light

Add a directional or point light source to a 3D scene.

h = light
h = light('Position', [x y z], ...)

Adds a light source to the current axes. Default is a directional light at (0, 0, 1). Trailing name-value pairs set position, color, and style. Affects rendering of surfaces with surfl-style lighting.

light('Position', [-1 0 1])
  • lightangle — Add or position a light source by azimuth and elevation.
  • surfl — 3D surface plot with lighting.