Why does the tiledlayout keep the whitespace between tiles although TileSpacing is 'tight'

28 次查看(过去 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
tl =
TiledChartLayout with properties: TileArrangement: 'fixed' GridSize: [3 2] Padding: 'none' TileSpacing: 'tight' Use GET to show all properties
  2 个评论
Stephen23
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.
Jonas
Jonas 2024-5-13
i know that the white space will not completly removed as when using 'none' as tile spacing option. nevertheless, the vertical and horizontal tile spacing is normally a bit more dense than shown in the figure

请先登录,再进行评论。

采纳的回答

Voss
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
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 个)

类别

Help CenterFile Exchange 中查找有关 Labels and Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by