Ellipses in 2D

MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.


plot::Ellipse2d(r1, r2, <[cx, cy]>, <a = amin .. amax>, options)


plot::Ellipse2d( r1, r2, [cx, cy] ) creates a 2D ellipse with center point [cx, cy] and semi-axes of lengths r1 and r2 for the horizontal and the vertical axis, respectively.

The symmetry axes of the ellipse are parallel to the coordinate axes. Use plot::Rotate2d to create ellipses of different orientation.

If the center point is not specified, an ellipse with center (0,0) is created.


AttributePurposeDefault Value
AffectViewingBoxinfluence of objects on the ViewingBox of a sceneTRUE
AntiAliasedantialiased lines and points?TRUE
Centercenter of objects, rotation center[0, 0]
CenterXcenter of objects, rotation center, x-component0
CenterYcenter of objects, rotation center, y-component0
Colorthe main colorRGB::Blue
Filledfilled or transparent areas and surfacesFALSE
FillColorcolor of areas and surfacesRGB::Red
FillPatterntype of area fillingDiagonalLines
Framesthe number of frames in an animation50
Legendmakes a legend entry 
LegendTextshort explanatory text for legend 
LegendEntryadd this object to the legend?FALSE
LineColorcolor of linesRGB::Blue
LineWidthwidth of lines0.35
LineStylesolid, dashed or dotted lines?Solid
LinesVisiblevisibility of linesTRUE
LineColorDirectionthe direction of color transitions on lines[0, 1]
LineColorDirectionXx-component of the direction of color transitions on lines0
LineColorDirectionYy-component of the direction of color transitions on lines1
Namethe name of a plot object (for browser and legend) 
ParameterEndend value of the animation parameter 
ParameterNamename of the animation parameter 
ParameterBegininitial value of the animation parameter 
ParameterRangerange of the animation parameter 
SemiAxessemi axes of ellipses and ellipsods[2, 1]
SemiAxisXfirst semi axis of ellipses and ellipsods2
SemiAxisYsecond semi axis of ellipses and ellipsods1
TimeEndend time of the animation10.0
TimeBeginstart time of the animation0.0
TimeRangethe real time span of an animation0.0 .. 10.0
Titleobject title 
TitleFontfont of object titles[" sans-serif ", 11]
TitlePositionposition of object titles 
TitleAlignmenthorizontal alignment of titles w.r.t. their coordinatesCenter
TitlePositionXposition of object titles, x component 
TitlePositionYposition of object titles, y component 
VisibleAfterobject visible after this time value 
VisibleBeforeobject visible until this time value 
VisibleFromToobject visible during this time range 
VisibleAfterEndobject visible after its animation time ended?TRUE
VisibleBeforeBeginobject visible before its animation time starts?TRUE


Example 1

Create a plot of an ellipse with center point (1,1) and semi-axes of lengths 3 and 1:

ellipse := plot::Ellipse2d(3, 1, [1, 1]):

Apply a rotation:

plot(ellipse, plot::Rotate2d(PI/4, [1, 1], ellipse))

delete ellipse:


r1, r2

The semi-axes of an ellipse. They must be real numerical values or arithmetical expressions of the animation parameter a.

r1, r2 are equivalent to the attributes SemiAxisX, SemiAxisY.

cx, cy

The center. The coordinates cx, cy must be real numerical values or arithmetical expressions of the animation parameter a. If no center is specified, the ellipse is centered at the origin.

cx, cy are equivalent to the attribute Center.


Animation parameter, specified as a = amin..amax, where amin is the initial parameter value, and amax is the final parameter value.

See Also

MuPAD Functions

MuPAD Graphical Primitives