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

42 Ansichten (letzte 30 Tage)
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 Kommentare
Stephen23
Stephen23 am 13 Mai 2024
"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 am 13 Mai 2024
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

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Voss
Voss am 13 Mai 2024
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 Kommentar
Voss
Voss am 13 Mai 2024
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by