View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

4.6 | 48 ratings Rate this file 193 Downloads (last 30 days) File Size: 2.26 KB File ID: #289 Version: 1.0



David Long (view profile)


Adds ellipses to the current plot

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| Watch this File

File Information

Adds ellipses to the current plot


This file inspired A Simple Sift Implementation With Pose Estimation, Pi Vlab Time Resolved Particle Image Velocimetry (Piv) Tool, and Psharma15/Get Mve.

MATLAB release MATLAB 5.2 (R10)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (57)

Hi David Long, is there any possibility to get a point on the ellipse that we get from your program

11 Feb 2017 light liu

very useful,thanks

11 Nov 2016 Jenny

Jenny (view profile)

Hi David, Thank you - I assumed as much but thought I ought to check! Thanks.

Comment only
11 Nov 2016 David Long

David Long (view profile)

There is a typo in the comments section. ra is the semimajor axis, rb is the semimionr axis (ra>=rb), and ang is the angle of the semimajor axis.

Comment only
10 Nov 2016 Jenny

Jenny (view profile)

Could anyone clarify for me the difference between ra and rb please? The function states that "% ELLIPSE(ra,rb,ang,x0,y0) adds an ellipse with semimajor axis of ra,
% a semimajor axis of radius rb, a semimajor axis of ang, centered at
% the point x0,y0."
I assume that one or the other should be semiminor axis?

Comment only
31 Aug 2016 Pragya Sharma

09 Nov 2015 David Long

David Long (view profile)

Using the pointer output ellipse as suggested in the previous comment, you can change the C argument to the standard patch command to use a vector (RGB) color. patch has some other interesting options you can use, too.

Comment only
09 Nov 2015 jaribeiro

If instead of filling the ellipse with a specific color, would it be possible to fill it according to a vector?
How could that be done?

Comment only
05 Apr 2015 ramin bba

thanks. With a minor change it worked. the outputs (x, y) are cells so using patch gave me an error. I put your code in a for loop to get around the problem:

for i=1:length(x)
hold on;
hold off;

Comment only
01 Apr 2015 David Long

David Long (view profile)

To efficiently produce a "filled" ellipse using this code, use the returned handle:
hold on;
hold off;

Comment only
01 Apr 2015 ramin bba

awesome code, helped me out a lot.

Do you have an efficient way in mind for "filling in" the ellipses? using patch maybe?

15 Jan 2015 Chris

Chris (view profile)

26 Sep 2014 Frank

Frank (view profile)

quite useful

01 Sep 2014 David Long

David Long (view profile)

R2014B graphics ready

Comment only
12 Aug 2014 Abhik

Abhik (view profile)

16 Aug 2013 Jay Patel

25 Jun 2013 Frederik

17 Aug 2012 Kuider

Kuider (view profile)

excellent! helped me a lot thank you

02 Nov 2011 Yuri K

Yuri K (view profile)

Congratulations for getting PoW! Great tool!

15 Aug 2011 Laurent Ballaz

28 Jun 2011 Nick Sinclair

16 May 2011 Nitin

Nitin (view profile)

23 Apr 2011 Zhang

Zhang (view profile)

very good, very appreciate

13 Feb 2011 Mohammed El-Said

Works Great,
Thanks for sharing...

09 Jan 2011 Ben Bauer

20 Nov 2010 piao lin

22 Feb 2010 Antonio

excellent work, useful and well documented¬°¬°¬°

05 Feb 2010 Chen Xing

Many thanks!! Quick and simple

22 Sep 2008 Bharat Pathak

Thank you very much.

30 May 2008 Tory C

Great! Thank you! Is there a quick way to make the line thickness bigger?? Cant find the obvious fix in the code.

16 Feb 2008 H J

16 Feb 2008 A K

so cool!

thanks a lot

05 Feb 2008 julio gomez

03 Feb 2008 Fabiano Giuliani

A perfect function to draw an ellipse. Thank you!

03 Jan 2008 Natt T


18 Oct 2007 MARGOT Gerritsen

Works like a treat

17 Oct 2007 Y Liu

21 Sep 2007 Andrzej Z

08 Nov 2006 Reza Zahiri

nice and clean piece of code, thanks for sharing

28 Sep 2006 kim jeongdae


01 Apr 2006 peppo franco

19 Mar 2006 jung sung yun

01 Feb 2006 Yassir Al-Jahdir

Thank you very much!!

16 May 2005 Kazimieras Bagdonas

thanx, yours function saved my day=)

12 May 2005 Sanith Wijesinghe


06 Apr 2005 Stephen Westland

Saved my bacon today. Perfect.

23 Sep 2004 Omar Muhanna

thank you very much for this file. because I was looking for such a function in MatLab that can draw for me an ellipse.but if you can send me the simpleat function for drawing such a simple ellipse I will be very greatful.

thank you...

19 May 2004 Richard Weaver

Excellent- just what I needed - allows full user specification of the ellipse parameters.

27 Mar 2004 peter YOU


18 Mar 2004 P Sirisalee

Many Thanks.

16 Feb 2004 Paul Larsen

Works great! Thanks a million.

03 Jan 2004 Yuval Tassa

Watch out for the missing semicolon in line 131. Otherwise, a great little util.

10 Nov 2003 Gregory B

Thanks a lot!

02 Oct 2003 Tom Thorvaldsen

Made my life much easier.

30 Sep 2003 Mark Wilde

i like a lot. makes me happier than the other 2 guys could ever be!

07 Sep 2003 ke wang

It helps me a lot! Thank you very much

Comment only
22 Aug 2002 L. O'Neill

This function is easy to use, logical, and does exactly what it says it will. I am very happy with it.

Contact us