sky
说明
示例
反转颜色图
绘制一个曲面并指定 sky 颜色图。
surf(peaks)
colormap("sky")
获取 sky 颜色图数组并反转顺序。然后将修改后的颜色图应用于该曲面。
c = sky; c = flipud(c); colormap(c)
下采样 Sky 颜色图
获取一个仅包含二十种颜色的下采样 sky 颜色图。然后通过应用颜色图和插补着色,显示 peaks 函数的轮廓。
c = sky(20);
surf(peaks)
colormap(c)
shading interp
比较包含不同颜色数的热图
默认情况下,热图使用 sky
颜色图的 256 采样。您可以通过指定 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))
输入参数
m
— 颜色数
256
(默认) | 非负整数
颜色数,指定为非负整数。m
的默认值为当前图窗的颜色图中的颜色数。如果不存在图窗,则默认值为 256
。
数据类型: single
| double
版本历史记录
在 R2023a 中推出
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)