主要内容

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

abyss

Abyss 颜色图数组

自 R2023b 起

  • Abyss colormap

说明

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

Sample of the abyss colormap

示例

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

示例

全部折叠

显示 membrane 函数的图像。

imagesc(membrane)

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

将颜色图更改为 abyss

colormap abyss

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

默认情况下,热图使用 sky 颜色图的 256 采样。您可以通过指定 heatmap 函数的 Colormap 名称-值参量来更改颜色图和采样。

例如,在 2×1 分块图布局中创建两个热图。上图使用 abyss 颜色图的 256 种颜色,下图仅使用两种颜色。

tiledlayout(2,1)

% Top chart with default number of colors
nexttile
cdata = magic(10);
heatmap(cdata,Colormap=abyss)
title("256 Colors")

% Bottom chart with two colors
nexttile
heatmap(cdata,Colormap=abyss(2))
title("2 Colors")

Figure contains objects of type heatmap. The chart of type heatmap has title 256 Colors. The chart of type heatmap has title 2 Colors.

输入参数

全部折叠

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

数据类型: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

版本历史记录

在 R2023b 中推出