Why does imagesc show different outputs for the same input matrix?
Mostrar comentarios más antiguos
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 comentarios
"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)
Respuesta aceptada
Más respuestas (1)
Divyajyoti Nayak
el 24 de Nov. de 2024
0 votos
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 comentarios
DGM
el 2 de Dic. de 2024
I admit, this was my first guess. The white page background made it hard to notice the "crease" in the image.
Categorías
Más información sobre Images en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



