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에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



