MATLAB 帮助中心
Sky 颜色图数组
自 R2023a 起
c = sky
c = sky(m)
c = sky 以三列数组形式返回 sky 颜色图,该数组包含的行数与当前图窗 (gcf) 的颜色图相同。如果不存在图窗,则行数为 256。数组中的每一行包含一种特定颜色的红、绿、蓝强度。强度介于 [0, 1] 范围内,颜色方案如下图所示。
gcf
示例
c = sky(m) 返回包含 m 种颜色的颜色图。
m
全部折叠
绘制一个曲面并指定 sky 颜色图。
surf(peaks) colormap("sky")
获取 sky 颜色图数组并反转顺序。然后将修改后的颜色图应用于该曲面。
c = sky; c = flipud(c); colormap(c)
获取一个仅包含二十种颜色的下采样 sky 颜色图。然后通过应用颜色图和插补着色,显示 peaks 函数的轮廓。
c = sky(20); surf(peaks) colormap(c) shading interp
默认情况下,热图使用 sky 颜色图的 256 采样。您可以通过指定 Colormap 名称-值参量来更改采样。
sky
Colormap
例如,在 2×1 分块图布局中创建两个热图。上图使用默认 256 种颜色,下图仅使用两种颜色。
tiledlayout(2,1,TileSpacing="compact") % Top chart with default colors nexttile heatmap(magic(10)) % Bottom chart with two colors nexttile heatmap(magic(10),Colormap=sky(2))
256
颜色数,指定为非负整数。m 的默认值为当前图窗的颜色图中的颜色数。如果不存在图窗,则默认值为 256。
数据类型: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
single
double
int8
int16
int32
int64
uint8
uint16
uint32
uint64
在 R2023a 中推出
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 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处