%% Add Colorbars to Tiled Chart Layout
% Starting in R2019b, you can display a tiling of plots using the tiledlayout and nexttile functions. Call the tiledlayout function to create a 2-by-1 tiled chart layout. Call the nexttile function to create the axes. Then display a surface plot in each axes with a colorbar.

tiledlayout(2,1)

% Top plot
nexttile 
surf(peaks)
colorbar

% Bottom plot
nexttile
mesh(peaks)
colorbar

% Copyright 2019 The MathWorks, Inc.