%% Irregular Grid of Plots
% Tiled chart layouts can be nested. This is useful for varying the arrangement of the tiles in a layout. In this case, create two columns that each have a different number of tiles.
% Create a 1-by-2 tiled layout called t1. Then create two nested layouts, t2 and t3, where t2 is in the first tile of t1, and t3 is in the second tile. Then display two contour plots in t2, and add a title above the plots.

figure
t1 = tiledlayout(1,2,'TileSpacing','Compact');
t2 = tiledlayout(t1,'flow','TileSpacing','Compact');
t3 = tiledlayout(t1,'flow','TileSpacing','Compact');
t3.Layout.Tile = 2;

% Add two contour plots to left side
[X,Y,Z] = peaks;
nexttile(t2);
contourf(X,Y,Z)
nexttile(t2)
contourf(X,Y,Z,10)
title(t2,"Contours of Peaks")

%
% Display three line plots within t3, and add a title.

nexttile(t3)
plot(Z(15,:))
nexttile(t3)
plot(Z(25,:))
nexttile(t3)
plot(Z(35,:))
title(t3,"Y = -1.25, 0, and 1.25")

% Copyright 2020 The MathWorks, Inc.