MATLAB 帮助中心
Turbo 颜色图数组
c = turbo
c = turbo(m)
c = turbo 以三列数组形式返回 turbo 颜色图,该数组包含的行数与当前图窗 (gcf) 的颜色图相同。如果不存在图窗,则行数等于默认长度 256。数组中的每一行包含一种特定颜色的红、绿、蓝强度。强度值在 [0,1] 范围内,颜色方案与 jet 颜色方案相似,但颜色之间的转换在感觉上比 jet 更柔和。颜色方案如下图所示。
gcf
jet
示例
c = turbo(m) 返回包含 m 种颜色的颜色图。
m
全部折叠
绘制曲面,并分配 turbo 颜色图。
surf(peaks); colormap('turbo');
获取 turbo 颜色图数组,并反转顺序。然后将修改后的颜色图应用于该曲面。
c = turbo; c = flipud(c); colormap(c);
获取仅包含十种颜色的下采样 turbo 颜色图。然后通过应用颜色图和插补着色,显示 peaks 函数的轮廓。
peaks
c = turbo(10); surf(peaks); colormap(c); shading interp;
创建一个包含 peaks 数据集的两个伪彩图的分块图布局。左图使用 jet 颜色图,右图使用 turbo 颜色图。请注意,turbo 图中颜色之间的转换较 jet 图中更为柔和。
t = tiledlayout(1,2); [X,Y,Z] = peaks; % Left image ax1 = nexttile; s1 = pcolor(ax1,X,Y,Z); s1.EdgeColor = 'none'; s1.FaceColor = 'interp'; ax1.Colormap = jet; title(ax1,'Jet'); % Right image ax2 = nexttile; s2 = pcolor(ax2,X,Y,Z); s2.EdgeColor = 'none'; s2.FaceColor = 'interp'; ax2.Colormap = turbo; title(ax2,'Turbo');
256
颜色数,指定为非负整数。m 的默认值为当前图窗的颜色图中的颜色数。如果不存在图窗,则默认值为 256。
数据类型: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
single
double
int8
int16
int32
int64
uint8
uint16
uint32
uint64
在 R2020b 中推出
colormap
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处