Figure Not Displaying Properly
Hello, I’m messing around with different slices of the brain, as shown below. Each image is essentially a 2D array visualized using imagesc, where each "pixel" corresponds to an element of the array. However, the subplots don’t appear to be scaling properly at all. Both the sagittal and coronal slice are 140 elements "tall", however because I assume MATLAB individually scales each subplot a certain way, they do not appear to be as tall as each other whatsoever. Similarly, the transverse slice should be as tall as the sagittal slice is wide (and the coronal slice should be as tall as the transverse slice is wide), but not of these dimensions match up. Here is a snippet of my code for troubleshooting purposes:
% sagittal slice, 165×140 2D array. for recreation purposes,
% you could functionally just make an 165×140 random matrix
ax1 = subplot(1, 3, 1);
imagesc(squeeze(maxS));
colormap(flipud(gray));
title("Sagittal View");
axis off;
axis image;
% coronal slice, 124×140 2D array
ax2 = subplot(1, 3, 2);
imagesc(squeeze(maxC));
colormap(flipud(gray));
title("Coronal View");
axis off;
axis image;
% transverse slice, 165×124 2D array
ax3 = subplot(1, 3, 3);
imagesc(maxT);
colormap(flipud(gray));
title("Transverse View");
axis off;
axis image;
Any and all help would be greatly appreciated. Thank you.Hello, I’m messing around with different slices of the brain, as shown below. Each image is essentially a 2D array visualized using imagesc, where each "pixel" corresponds to an element of the array. However, the subplots don’t appear to be scaling properly at all. Both the sagittal and coronal slice are 140 elements "tall", however because I assume MATLAB individually scales each subplot a certain way, they do not appear to be as tall as each other whatsoever. Similarly, the transverse slice should be as tall as the sagittal slice is wide (and the coronal slice should be as tall as the transverse slice is wide), but not of these dimensions match up. Here is a snippet of my code for troubleshooting purposes:
% sagittal slice, 165×140 2D array. for recreation purposes,
% you could functionally just make an 165×140 random matrix
ax1 = subplot(1, 3, 1);
imagesc(squeeze(maxS));
colormap(flipud(gray));
title("Sagittal View");
axis off;
axis image;
% coronal slice, 124×140 2D array
ax2 = subplot(1, 3, 2);
imagesc(squeeze(maxC));
colormap(flipud(gray));
title("Coronal View");
axis off;
axis image;
% transverse slice, 165×124 2D array
ax3 = subplot(1, 3, 3);
imagesc(maxT);
colormap(flipud(gray));
title("Transverse View");
axis off;
axis image;
Any and all help would be greatly appreciated. Thank you. Hello, I’m messing around with different slices of the brain, as shown below. Each image is essentially a 2D array visualized using imagesc, where each "pixel" corresponds to an element of the array. However, the subplots don’t appear to be scaling properly at all. Both the sagittal and coronal slice are 140 elements "tall", however because I assume MATLAB individually scales each subplot a certain way, they do not appear to be as tall as each other whatsoever. Similarly, the transverse slice should be as tall as the sagittal slice is wide (and the coronal slice should be as tall as the transverse slice is wide), but not of these dimensions match up. Here is a snippet of my code for troubleshooting purposes:
% sagittal slice, 165×140 2D array. for recreation purposes,
% you could functionally just make an 165×140 random matrix
ax1 = subplot(1, 3, 1);
imagesc(squeeze(maxS));
colormap(flipud(gray));
title("Sagittal View");
axis off;
axis image;
% coronal slice, 124×140 2D array
ax2 = subplot(1, 3, 2);
imagesc(squeeze(maxC));
colormap(flipud(gray));
title("Coronal View");
axis off;
axis image;
% transverse slice, 165×124 2D array
ax3 = subplot(1, 3, 3);
imagesc(maxT);
colormap(flipud(gray));
title("Transverse View");
axis off;
axis image;
Any and all help would be greatly appreciated. Thank you. figure MATLAB Answers — New Questions