shading

Sets how color is shaded across surfaces and patches.

Category: Graphics > Formatting and Annotation

Syntax

shading flat

One color per face and no mesh lines.

shading interp

Interpolates colors smoothly across faces, again without mesh lines.

shading faceted

One color per face with black mesh lines. This is the default.

shading(ax, option)

Applies the option to the axes ax.

Description

shading changes the face and edge colors of the surface and patch objects in the axes. After surf the default faceted look is easy to see; shading interp removes the grid and blends the colors for a smooth surface, which is the usual choice for finely sampled data.

The command works on objects that already exist, so it comes after the plot call. It sets color, whereas lighting and material control light.

Input arguments

option
'flat', 'interp' or 'faceted'.

Example

Smooth surface

surf(peaks(30))
shading interp
colorbar

In the app, the figure is drawn below the code.

See also

surf lighting material colormap light