%% Change View of Specific Axes
% Starting in R2019b, you can display a tiling of plots using the tiledlayout and nexttile functions. Call the tiledlayout function to create a 1-by-2 tiled chart layout. Call the nexttile function to create the axes objects ax1 and ax2. Use them to create separate but identical line plots.

t = 0:pi/20:10*pi;
xt1 = sin(t);
yt1 = cos(t);
tiledlayout(1,2)

% Left plot
ax1 = nexttile;
plot3(ax1,xt1,yt1,t)
xlabel('X')
ylabel('Y')
zlabel('Z')

% Right plot
ax2 = nexttile;
plot3(ax2,xt1,yt1,t)
xlabel('X')
ylabel('Y')
zlabel('Z')

%
% Change the view of the right plot to a side view along the x-axis.

view(ax2,[90 0]);

% Copyright 2019 The MathWorks, Inc.