メインコンテンツ

nebula

nebula カラーマップ配列

R2025a 以降

  • Nebula colormap

説明

c = nebula は、現在の Figure (gcf) のカラーマップと同じ行数をもつ 3 列配列として nebula カラーマップを返します。Figure が存在しない場合、行数は既定の長さ 256 と等しくなります。配列の各行には、特定の色の赤、緑、青の強度が格納されます。強度値は [0, 1] の範囲であり、カラー スキームは次のイメージのように表示されます。

Sample of the nebula colormap

c = nebula(m) は、m 色のカラーマップを返します。

すべて折りたたむ

らせんをプロットし、nebula カラーマップを割り当てます。

numLoops = 20;
numPtsPerLoop = 196;
theta = linspace(0,numLoops*2*pi,numPtsPerLoop);
d = exp(0.25*theta/numLoops);
x = d.*cos(theta);
y = d.*sin(theta);
s = scatter(x,y,32*d,d,"filled");
axis square
colormap nebula

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

nebula カラーマップ配列を取得し、順序を逆にします。次に、変更したカラーマップをらせんに適用します。

c = nebula;
c = flipud(c);
colormap(c);

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

既定では、ヒートマップ チャートは sky カラーマップの 256 色のサンプリングを使用します。関数 heatmap の名前と値の引数 Colormap を指定して、カラーマップとサンプリングを変更できます。

たとえば、2 行 1 列のタイル表示チャート レイアウトで 2 つのヒートマップ チャートを作成します。上のチャートでは nebula カラーマップの 256 色を使用しており、下のチャートでは 2 色のみを使用しています。

tiledlayout(2,1)

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

% Bottom chart with two colors
nexttile
heatmap(cdata,Colormap=nebula(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 の既定値は現在の Figure のカラーマップの色の数です。Figure が存在しない場合、既定値は 256 です。

データ型: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

バージョン履歴

R2025a で導入