%% Modify Axes Properties After Creation
% Create a figure with two subplots. Assign the Axes objects to the variables ax1 and ax2. Specify the Axes objects as inputs to the plotting functions to ensure that the functions plot into a specific subplot.

ax1 = subplot(2,1,1);
Z = peaks;
plot(ax1,Z(1:20,:))

ax2 = subplot(2,1,2);  
plot(ax2,Z)

%
% Modify the axes by setting properties of the Axes objects. Change the font size for the upper subplot and the line width for the lower subplot. Some plotting functions set axes properties. Execute plotting functions before specifying axes properties to avoid overriding existing axes property settings. Use dot notation to set properties.

ax1.FontSize = 15;
ax2.LineWidth = 2;

% Copyright 2015 The MathWorks, Inc.