how can I make a specified interval a specified color?

9 ビュー (過去 30 日間)
Samaneh Arzpeima
Samaneh Arzpeima 2018 年 10 月 10 日
編集済み: Samaneh Arzpeima 2018 年 10 月 10 日
I am plotting the slip distribution of some FEM simulation.my color bar is shown between [0 10], though I need to show the slip above some threshold only. 0 means that my fault didn’t slip at all, and I also want to assume that parts with slip under 62cm will be almost the same as 0. how can I do that? editing the color bar, does not let me to make to color the exact 0 to 62 white.
I have several graph, I want all of them to have color bar[0 10] with the same intervals,just the white part will be different in each. as my threshold for minimum slip is 10% of the max slip.

採用された回答

Image Analyst
Image Analyst 2018 年 10 月 10 日
Try this:
data = randi(10, 30, 40); % Create sample data
imshow(data, 'InitialMagnification', 1600);
axis('on', 'image');
cMap = parula(10)
caxis([0, 10]);
threshold = 3; % Wherever
cMap(1:threshold, :) = 1
colormap(cMap);
colorbar;
  1 件のコメント
Samaneh Arzpeima
Samaneh Arzpeima 2018 年 10 月 10 日
編集済み: Samaneh Arzpeima 2018 年 10 月 10 日
Almost what I want!Thank you very much. but it sounds like I can not choose the threshhold like 0.62m(my colorbar in temp)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOrange についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by