Main Content

本页翻译不是最新的。点击此处可查看最新英文版本。

bone

bone 颜色图数组

  • Bone colormap

说明

示例

c = bone 以三列数组形式返回 bone 颜色图,其中包含的行数与当前图窗 (gcf) 的颜色图相同。如果不存在图窗,则行数等于默认长度 256。数组中的每一行包含一种特定颜色的红、绿、蓝强度。强度介于 [0,1] 范围内,颜色方案如下图所示。

Sample of the bone colormap

示例

c = bone(m) 返回包含 m 种颜色的颜色图。

示例

全部折叠

绘制一个曲面并指定 bone 颜色图。

surf(peaks);
colormap('bone');

Figure contains an axes object. The axes object contains an object of type surface.

获取 bone 颜色图数组并反转顺序。然后将修改后的颜色图应用于该曲面。

c = bone;
c = flipud(c);
colormap(c);

Figure contains an axes object. The axes object contains an object of type surface.

获取仅包含二十种颜色的下采样 bone 颜色图。然后通过应用颜色图和插补着色显示抛物面的轮廓。

c = bone(20);
[X,Y] = meshgrid(-10:1:10);
Z = X.^2 + Y.^2;
surf(X,Y,Z);
colormap(c);
shading interp;

Figure contains an axes object. The axes object contains an object of type surface.

输入参数

全部折叠

颜色数,指定为非负整数。m 的默认值为当前图窗的颜色图中的颜色数。如果不存在图窗,则默认值为 256

数据类型: single | double

版本历史记录

在 R2006a 之前推出

全部展开