Reducing Whitespace for a 2x3 subplot

7 次查看(过去 30 天)
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 个)

标签

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by