Why does imagesc show different outputs for the same input matrix?
古いコメントを表示
ppmap_debug was visualized using imagesc as follows:
% figure 1
figure;
imagesc('CData',ppmap_debug,'XData',xBydVec,'YData',yBydVec_debug)
axis tight equal
ppmap_debug and yBydVec_debug are formed as follows:
ppmap_debug = [pp_Region2;pp_Region3];
yBydVec_debug = [yBydVec_Region2 yBydVec_Region3];
pp_Region2 and pp_Region3 were also visualized separately as follows:
% figure 2
figure;
imagesc('CData',pp_Region2,'XData',xBydVec,'YData',yBydVec_Region2);
hold on
imagesc('CData',pp_Region3,'XData',xBydVec,'YData',yBydVec_Region3);
axis tight equal
figure 1 and figure 2 do not match as shown below. Why? Shouldn't they be the same?

pp_Region2, pp_Region3, yBydVec_Region2, yBydVec_Region3, and xBydVec have been provided to run the above code snippets.
2 件のコメント
"Why? Shouldn't they be the same?"
Nothing in your question explains why different data should be visualised the same.
M2 = load('pp_Region2.mat').pp_Region2
M3 = load('pp_Region3.mat').pp_Region3
surf(M3-M2)
採用された回答
その他の回答 (1 件)
Divyajyoti Nayak
2024 年 11 月 24 日
0 投票
From what I can tell, the reason the two figures are slightly different is because for figure 1 the colors are being scaled off the maximum and minimum values of 'ppmap_debug'. While for the second figure, it is formed by the stitching together of two plots whose colors are scaled by their individual maximum and minimum values of 'CData'.
2 件のコメント
DGM
2024 年 12 月 2 日
I admit, this was my first guess. The white page background made it hard to notice the "crease" in the image.
カテゴリ
ヘルプ センター および File Exchange で Images についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



