Why does the tiledlayout keep the whitespace between tiles although TileSpacing is 'tight'
42 次查看(过去 30 天)
显示 更早的评论
dear community,
i have a tiledlayout with TileSpacing set to 'tight', but the upper row keeps space below it, altough there is noting to keep space for. there is also no whitespace title in row 2 or something like that. Any idea? I am on 2022a.
fig=openfig('spaceBetweenTilesNotClosing.fig');
annotation("rectangle",'Position',[0.0563,0.629,0.9115,0.09708],'Color','g');
tl=findall(fig,'type','tiledlayout');
tl
2 个评论
Stephen23
2024-5-13
"Any idea?"
The TILEDLAYOUT documentation does not show or describe that the TILESPACING="TIGHT" option wil remove all whitespace. What specific part of the documentation makes you think that it should?
Perhaps you were thinking of the "NONE" option, which does remove all whitespace from between the axes.
采纳的回答
Voss
2024-5-13
I guess the "tiled" part of "tiledlayout" implies that all contained axes are the same size and that the amount of space between adjacent axes is the same. So even though nothing needs to go in the space between the top row of axes and the second row, the space needs to be there since there is stuff (xlabels and xticklabels) that goes underneath the axes in the other rows.
1 个评论
Voss
2024-5-13
Original - constant space between rows of axes:
fig=openfig('spaceBetweenTilesNotClosing.fig');
With xticklabels and xlabels set to empty, there is a smaller constant space between rows of axes:
fig=openfig('spaceBetweenTilesNotClosing.fig');
tl=findall(fig,'type','tiledlayout');
ax = tl.Children;
t = get(ax,'XLabel');
set([t{:}],'String','');
set(ax,'XTickLabel',{})
With no xlabels and only one axes having xticklabels, there is still constant space between rows of axes, just enough to accommodate the tick labels:
fig=openfig('spaceBetweenTilesNotClosing.fig');
tl=findall(fig,'type','tiledlayout');
ax = tl.Children;
t = get(ax,'XLabel');
set([t{:}],'String','');
set(ax,'XTickLabel',{})
set(ax(4),'XTickLabelMode','auto')
With no xticklabels and only one axes having an xlabel, there is still constant space between rows of axes, just enough to accommodate the xlabel:
fig=openfig('spaceBetweenTilesNotClosing.fig');
tl=findall(fig,'type','tiledlayout');
ax = tl.Children;
t = get(ax,'XLabel');
set([t{:}],'String','');
t{5}.String = 'Lab^e_l';
set(ax,'XTickLabel',{})
In all cases, the space between rows is the same and is just enough to accommodate what's needed.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!