| MATLAB Functions | Help Desk |
shading
Set color shading propertiesshading flat shading faceted shading interpThe
shading function controls the color shading of Surface and Patch graphics objects.
shading flat
sets each mesh line segment, Surface face, or Patch face to a constant color determined by the color values at the end points of the segment, or the corners of the Surface face or Patch.
shading faceted
sets the shading to flat with individual faces outlined in black. This is the default shading mode.
shading interp
varies the color in each line segment, Surface face, or Patch face by interpolating the colormap index or true color value across the face or line.
Compare a flat-shaded sphere with a Gouraud-shaded sphere:
colormap gray
subplot(1,2,1)
surf(peaks(10));
axis square
shading flat
title('Flat Shading')
subplot(1,2,2)
surf(peaks(10));
axis square
shading interp
title('Interpolated Shading')
shading sets the EdgeColor and FaceColor properties of all Surface and Patch graphics objects in the current Axes. shading sets the appropriate values, depending on whether the Surface or Patch objects represent meshes or solid surfaces.
Thefill,fill3,hidden,mesh,patch,pcolor,surf
EdgeColor and FaceColor properties for Surface and Patch graphics objects.