%% Export Tiled Chart Layout
% Display two plots in a tiled chart layout. Then save both plots as a PDF by passing the TiledChartLayout object to the exportgraphics function.

t = tiledlayout(2,1);
nexttile
plot([1 2 3])
nexttile
plot([3 2 1])
exportgraphics(t,'Layout.pdf')

% If you want to save just one of the plots in the layout, call the nexttile function with the axes return argument. Then pass the axes to the exportgraphics function.
% Copyright 2019 The MathWorks, Inc.