www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/MakingSurfacesTransparentLearnMLExample.m
%% Making Surfaces Transparent % This example shows how you can make the faces of a surface transparent to % a varying degree. Transparency (referred to as the alpha value) can be specified for the whole object or can be based on an |alphamap| , which behaves similarly to colormaps. % Copyright 2015 The MathWorks, Inc. [X,Y] = meshgrid(-8:.5:8); R = sqrt(X.^2 + Y.^2) + eps; Z = sin(R)./R; surf(X,Y,Z) colormap hsv alpha(.4) %% % MATLAB displays a surface with a face alpha value of 0.4. Alpha values range from 0 (completely transparent) to 1 (not transparent).