bone
bone 颜色图数组
说明
示例
反转颜色图
绘制一个曲面并指定 bone 颜色图。
surf(peaks);
colormap('bone');
获取 bone 颜色图数组并反转顺序。然后将修改后的颜色图应用于该曲面。
c = bone; c = flipud(c); colormap(c);
下采样 bone 颜色图
获取仅包含二十种颜色的下采样 bone 颜色图。然后通过应用颜色图和插补着色显示抛物面的轮廓。
c = bone(20);
[X,Y] = meshgrid(-10:1:10);
Z = X.^2 + Y.^2;
surf(X,Y,Z);
colormap(c);
shading interp;
输入参数
m
— 颜色数
256
(默认) | 整数标量值
颜色数,指定为整数标量值。m
的默认值等于当前图窗的颜色图的长度。如果不存在图窗,则默认值为 256。
数据类型: single
| double
版本历史记录
在 R2006a 之前推出R2019b: 默认情况下,颜色图有 256 种颜色
从 R2019b 开始,颜色图默认有 256 种颜色。
在 R2019a 和以前的版本中,默认大小为 64。如果您的代码依赖于有 64 种颜色的颜色图,请在为图窗、坐标区或图设置颜色图时指定颜色数。例如,colormap(bone(64))
将图窗的颜色图设置为 64 色 bone
颜色图。
您也可以更改 MATLAB® 会话内所有图窗的默认颜色图:
set(groot,'defaultFigureColormap',bone(64))
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)