Reducing Whitespace for a 2x3 subplot

조회 수: 4 (최근 30일)
Hans123
Hans123 2022년 10월 25일
댓글: J. Alex Lee 2022년 10월 26일
I am trying to reduce the whitespace between a 2x3 grid of images.
I have tried subplot and tiledlayout--codes and images below--apparently to preserve scaling, the spacing and padding options for TiledLayout does not work.
I would greatly appreciate any pointers on reduce the white space between the 6 images (in a 2x3) plot
figure;
subplot(2, 3, 1);
imshow((An{1})); title('$A_{50}$',FontSize=16,Interpreter='latex')
subplot(2, 3, 2);
imshow((An{2})); title('$A_{100}$',FontSize=16,Interpreter='latex')
subplot(2, 3, 3);
imshow((An{3})); title('$A_{200}$',FontSize=16,Interpreter='latex')
subplot(2, 3, 4);
imshow((An{4})); title('$A_{300}$',FontSize=16,Interpreter='latex')
subplot(2, 3, 5);
imshow((An{5})); title('$A_{400}$',FontSize=16,Interpreter='latex')
subplot(2, 3, 6);
imshow((An{5})); title('Original',FontSize=16,Interpreter='latex')
sgtitle('The title',FontSize=16,Interpreter='latex')
figure;
tiledlayout(2,3,"TileSpacing","none",Padding="tight")
imshow((An{1})); title('$A_{50}$',FontSize=16,Interpreter='latex')
nexttile
imshow((An{2})); title('$A_{100}$',FontSize=16,Interpreter='latex')
nexttile
imshow((An{3})); title('$A_{200}$',FontSize=16,Interpreter='latex')
nexttile
imshow((An{4})); title('$A_{300}$',FontSize=16,Interpreter='latex')
nexttile
imshow((An{5})); title('$A_{400}$',FontSize=16,Interpreter='latex')
nexttile
imshow((A)); title('Original',FontSize=16,Interpreter='latex')
  댓글 수: 2
dpb
dpb 2022년 10월 25일
Anything tighter than that obtained with the named parameters you'll have to create by either adjusting the axes 'Position' property after creation or create them manually from the git-go with axes
J. Alex Lee
J. Alex Lee 2022년 10월 26일
i think the issue is not with tiledlayout - in my experience "tight" is "really tight"...i think the issue is that since your tiles contain images, and imshow may be doing something independently to preserve aspect ratio and/or scale...for example, if you resize the figure and adjust its aspect ratio, do you find a point where the images fill up the space better?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

태그

제품


릴리스

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by