which colormap I can chose to draw these figures?

1 回表示 (過去 30 日間)
Ahmed
Ahmed 2024 年 2 月 7 日
コメント済み: Ahmed 2024 年 2 月 8 日
Which colormap I can use to plot following figures? or any unction or code to create following figures by using imagesc?

採用された回答

DGM
DGM 2024 年 2 月 8 日
編集済み: DGM 2024 年 2 月 8 日
Attached are colormap generators that attempts to make something close to the given colormaps. It's only a blind approximation, but it's closer. The three images don't use the same colormap, so here are three different versions. Pick one.
load SNR.mat
% the first map is a 5-point map with dark endpoints and a white center
imagesc(Snear)
colormap(bluewhitered1(256))
% the second map is a 3-point map with bright endpoints and a white center
figure
imagesc(Snear)
colormap(bluewhitered2(256))
% the third map is a 5-point map with slightly dark endpoints and a gray center
figure
imagesc(Snear)
colormap(bluewhitered3(256))
Bear in mind that there isn't a way to back-calculate the colormap from the image alone. The progression is all guesswork, and the rest is just PWL interpolation in RGB based on those guesses and a sampling of the provided colors.
  1 件のコメント
Ahmed
Ahmed 2024 年 2 月 8 日
Thank you, the last one is much closer.

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

その他の回答 (1 件)

Image Analyst
Image Analyst 2024 年 2 月 7 日
Hard to say without knowing the data values but it looks like a ramp of red and an inverse ramp of blue with white in the middle. Maybe try something like
numColors = 256;
triangle = [linspace(0, 1, numColors/2)'; linspace(1, 0, numColors/2)'];
r = triangle;
g = triangle;
b = triangle;
r(numColors/2 + 1 : end) = 1;
b(1 : numColors/2) = 1;
plot(r, 'r-', 'LineWidth', 3);
hold on;
plot(g, 'g-', 'LineWidth', 3);
plot(b, 'b-', 'LineWidth', 3);
title("Custom Color Map")
grid on;
% Make the colormap
cmap = [r, g, b];
  1 件のコメント
Ahmed
Ahmed 2024 年 2 月 7 日
編集済み: Walter Roberson 2024 年 2 月 7 日
@Image Analyst data is plotted as, for example,
ntr = 227;
t = 116 * 1 size
Snear = 116 * 227 Size
(i.e. crest and trough)
figure, imagesc([1:ntr], t, Snear)
The data for the first figure is attached here as SNR.mat, only have Snear.

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by