Create light object
light('
PropertyName
',propertyvalue,...)
light(ax,...)
handle = light(...)
For a list of properties, see Light Properties.
light
creates a light object in the current
axes. Lights affect only patch and surface objects.
light('
creates
a light object using the specified values for the named properties.
For a description of the properties, see Light Properties. The MATLAB® software parents
the light to the current axes unless you specify another axes with
the PropertyName
',propertyvalue,...)Parent
property.
light(ax,...)
creates the light in the
axes specified by ax
instead of in the current
axes (gca
). The option ax
can
precede any of the input argument combinations in the previous syntaxes.
handle = light(...)
returns the handle
of the light object created.
Light the peaks
surface
plot with a local light source oriented along the direction defined
by the vector [-1 0 0]
, that is, looking from 0
along
the positive x-axis.
surf(peaks,'FaceLighting','gouraud','FaceColor','interp',... 'AmbientStrength',0.5) light('Position',[-1 0 0],'Style','local')
For more information about lighting, see Lighting Overview.