Problem plotting with imagesc

4 ビュー (過去 30 日間)
Yonatan Gershuni
Yonatan Gershuni 2020 年 11 月 9 日
コメント済み: Yonatan Gershuni 2020 年 11 月 10 日
Hi there,
I'de like to create a 2D plot with a 3rd dimension in colorscale exactly like 'imagesc' does but with a controlable y scale. When using imagesc(X,Y,Z) it sets the Y scale linear between the two ends of the Y vector ignoring everything in between.
Is there a way to do so? maybe by modifying the 'imagesc' function itself or perhaps by another function?
p.s I know that function such as 'pcolor' allows such scaling but it does not plot the same output as i require (and imagesc gives).
Thanks in advance
Y

採用された回答

Mathieu NOE
Mathieu NOE 2020 年 11 月 9 日
hello
this is the way I control the Z scale rendering of imagesc :
A = rand(100,100);
figure(1);imagesc(A);colorbar('vert');
% let's say we don't want to display values below "lower_limit" and above "upper_limit"
lower_limit = 0.75;
upper_limit = 0.9;
A(A<lower_limit) = lower_limit; % or NaN
A(A>upper_limit) = upper_limit; % or NaN
figure(2);imagesc(A);colorbar('vert');
  5 件のコメント
Mathieu NOE
Mathieu NOE 2020 年 11 月 10 日
Yonatan Gershuni
Yonatan Gershuni 2020 年 11 月 10 日
It works! Thank you very much!

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by