How can i set color range in 2D plot?

13 ビュー (過去 30 日間)
SWAGATA BHUNIA
SWAGATA BHUNIA 2016 年 5 月 21 日
回答済み: Walter Roberson 2016 年 5 月 21 日
I am getting 2D plot by using imagesc(..,z) command but here i need white color for lower value of Z(z is a 2*2 matrix) means if my z_max 1000, then below 50 i want to get white color. How can i do this?
  1 件のコメント
SWAGATA BHUNIA
SWAGATA BHUNIA 2016 年 5 月 21 日
Sorry, my Z is n*n matrix.

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 5 月 21 日
z_cutoff = 50;
cmap = colormap();
cmap(1,:) = [1 1 1]; %white
colormap(cmap);
zmax = max(z(:));
caxis([z_cutoff, zmax]);

カテゴリ

Help Center および File ExchangeColor and Styling についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by