Why does imagesc show different outputs for the same input matrix?
Afficher commentaires plus anciens
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 commentaires
"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)
Réponse acceptée
Plus de réponses (1)
Divyajyoti Nayak
le 24 Nov 2024
0 votes
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 commentaires
DGM
le 2 Déc 2024
I admit, this was my first guess. The white page background made it hard to notice the "crease" in the image.
Catégories
En savoir plus sur Images dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



