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

39 ビュー (過去 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 Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by