%% Create Ellipse Annotation
% Create a simple line plot and add an ellipse annotation to the figure. Specify dim as the size and location of the smallest rectangle that encloses the ellipse.

figure
x = linspace(-4,4);
y = x.^3 - 12*x;
plot(x,y)

dim = [.2 .74 .25 .15];
annotation('ellipse',dim)

%
% Draw a red rectangle using the same dimensions to show how the ellipse fills the rectangular area.

annotation('rectangle',dim,'Color','red')

% Copyright 2015 The MathWorks, Inc.