%% Position Multiple Axes in Figure
% Position two Axes objects in a figure and add a plot to each one.
% Specify the position of the first Axes object so that it has a lower left corner at the point (0.1 0.1) with a width and height of 0.7. Specify the position of the second Axes object so that it has a lower left corner at the point (0.65 0.65) with a width and height of 0.28. By default, the values are normalized to the figure. Return the Axes objects as ax1 and ax2.

figure
ax1 = axes('Position',[0.1 0.1 0.7 0.7]);
ax2 = axes('Position',[0.65 0.65 0.28 0.28]);

%
% Add a plot to each Axes object. Specify the axes by passing it as the first input argument to the graphics function. Most graphics functions reset some axes properties, such as the tick values and labels. However, they do not reset the axes position.

contour(ax1,peaks(20))
surf(ax2,peaks(20))

% Copyright 2012 The MathWorks, Inc.