你可以玩colormap和第四个输入surf.
以下情节

由...产生
[X,Y,Z] = peaks(1000);
%colormap
cmap = [0.6 0.2 0.4;
0.5 0.5 0.5;
0.1 0.9 0.9];
Zcolor = zeros(size(Z));
threshold = 2;
Zcolor(Z <= -threshold) = 1; % first row of cmap
Zcolor(Z > -threshold & Z < threshold) = 2; % second row of cmap
Zcolor(Z >= threshold) = 3; % third row of cmap
figure('Color','w');
surf(X, Y, Z, Zcolor, 'EdgeColor', 'None');
colormap(cmap);
light('Position', [0 -2 1])
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1476 次 |
| 最近记录: |