%% Create Flow Layout
% If a tiled chart layout does not already exist, nexttile creates one.
% Create four coordinate vectors: x, y1, y2, and y3. Next, call the nexttile function to create a tiled chart layout and an axes object in the first tile. Then plot y1 in the first tile. This first plot fills the entire layout because nexttile creates the layout using the 'flow' tile arrangement.

x = linspace(0,30);
y1 = sin(x/2);
y2 = sin(x/3);
y3 = sin(x/4);

% Plot into first tile three times
nexttile
plot(x,y1)

%
% Create a second tile and axes, and plot into the axes.

nexttile
plot(x,y2)

%
% Repeat the process to create a third plot.

nexttile
plot(x,y3)

%
% Repeat the process to create a fourth plot. This time, plot all three lines in the same axes by calling hold on after plotting y1.

nexttile
plot(x,y1)
hold on
plot(x,y2)
plot(x,y3)
hold off

% Copyright 2019 The MathWorks, Inc.