Back to Data Visualization

shading

Set surface shading mode

Syntax

shading faceted
shading flat
shading interp

Description

Controls the color shading of surface and mesh plots. 'faceted' uses flat coloring with black mesh lines overlaid (default). 'flat' uses flat coloring without mesh lines. 'interp' uses smooth interpolated colors across the surface.

Parameters

NameDescription
modeShading mode: 'faceted' (default), 'flat', or 'interp'

Returns

null

Examples

Try It
>> surf(peaks(30));
shading interp
Try It
>> [X, Y] = meshgrid(-2:0.2:2);
Z = X .* exp(-X.^2 - Y.^2);
surf(X, Y, Z);
shading flat;
colorbar

See Also