Nesting tiledlayouts within another tiledlayout
I would like to created a tiledlayout and, within each of the tiles, start another tiledlayout. I assume this kind of nesting is possible since, in the documentation for TiledChartLayout objects, it says that the parent of a TiledChartLayout can be another TiledChartLayout. However, the following example fails to produce the desired nesting. Instead of nesting the second sub-layout in the second tile, it tries to put it in the first tile. Is it possible to do what I am trying to do? If not, under what circumstances does it make sense to parent a TiledChartLayout to another TiledChartLayout.
m1=[5,6];
m2=[1,1,1,2];
T=tiledlayout(3,1); %Outer layout
nexttile(T,[1,1]); axis off %Next outer tile
t=tiledlayout(T,1,2); %first inner layout
for i=1:2
nexttile(t);
plot(rand(5,m1(i)));
legend(‘Location’,’southoutside’)
end
nexttile(T,[2,1]); axis off %Next outer tile
t=tiledlayout(T,2,2); %second inner layout
for i=1:4
nexttile(t);
plot(rand(5,m2(i)));
legend(‘Location’,’southoutside’)
endI would like to created a tiledlayout and, within each of the tiles, start another tiledlayout. I assume this kind of nesting is possible since, in the documentation for TiledChartLayout objects, it says that the parent of a TiledChartLayout can be another TiledChartLayout. However, the following example fails to produce the desired nesting. Instead of nesting the second sub-layout in the second tile, it tries to put it in the first tile. Is it possible to do what I am trying to do? If not, under what circumstances does it make sense to parent a TiledChartLayout to another TiledChartLayout.
m1=[5,6];
m2=[1,1,1,2];
T=tiledlayout(3,1); %Outer layout
nexttile(T,[1,1]); axis off %Next outer tile
t=tiledlayout(T,1,2); %first inner layout
for i=1:2
nexttile(t);
plot(rand(5,m1(i)));
legend(‘Location’,’southoutside’)
end
nexttile(T,[2,1]); axis off %Next outer tile
t=tiledlayout(T,2,2); %second inner layout
for i=1:4
nexttile(t);
plot(rand(5,m2(i)));
legend(‘Location’,’southoutside’)
end I would like to created a tiledlayout and, within each of the tiles, start another tiledlayout. I assume this kind of nesting is possible since, in the documentation for TiledChartLayout objects, it says that the parent of a TiledChartLayout can be another TiledChartLayout. However, the following example fails to produce the desired nesting. Instead of nesting the second sub-layout in the second tile, it tries to put it in the first tile. Is it possible to do what I am trying to do? If not, under what circumstances does it make sense to parent a TiledChartLayout to another TiledChartLayout.
m1=[5,6];
m2=[1,1,1,2];
T=tiledlayout(3,1); %Outer layout
nexttile(T,[1,1]); axis off %Next outer tile
t=tiledlayout(T,1,2); %first inner layout
for i=1:2
nexttile(t);
plot(rand(5,m1(i)));
legend(‘Location’,’southoutside’)
end
nexttile(T,[2,1]); axis off %Next outer tile
t=tiledlayout(T,2,2); %second inner layout
for i=1:4
nexttile(t);
plot(rand(5,m2(i)));
legend(‘Location’,’southoutside’)
end tiledchartlayout, nesting, tiledlayout, nexttile MATLAB Answers — New Questions