matplotlib.patches.Ellipse — Matplotlib 3.10.1 documentation (original) (raw)

class matplotlib.patches.Ellipse(xy, width, height, *, angle=0, **kwargs)[source]#

Bases: Patch

A scale-free ellipse.

Parameters:

xy(float, float)

xy coordinates of ellipse centre.

widthfloat

Total length (diameter) of horizontal axis.

heightfloat

Total length (diameter) of vertical axis.

anglefloat, default: 0

Rotation in degrees anti-clockwise.

Notes

Valid keyword arguments are:

property angle#

Return the angle of the ellipse.

property center#

Return the center of the ellipse.

get_angle()[source]#

Return the angle of the ellipse.

get_center()[source]#

Return the center of the ellipse.

get_co_vertices()[source]#

Return the co-vertices coordinates of the ellipse.

The definition can be found here

Added in version 3.8.

get_corners()[source]#

Return the corners of the ellipse bounding box.

The bounding box orientation is moving anti-clockwise from the lower left corner defined before rotation.

get_height()[source]#

Return the height of the ellipse.

get_patch_transform()[source]#

Return the Transform instance mapping patch coordinates to data coordinates.

For example, one may define a patch of a circle which represents a radius of 5 by providing coordinates for a unit circle, and a transform which scales the coordinates (the patch coordinate) by 5.

get_path()[source]#

Return the path of the ellipse.

get_vertices()[source]#

Return the vertices coordinates of the ellipse.

The definition can be found here

Added in version 3.8.

get_width()[source]#

Return the width of the ellipse.

property height#

Return the height of the ellipse.

set(*, agg_filter=, alpha=, angle=, animated=, antialiased=, capstyle=, center=, clip_box=, clip_on=, clip_path=, color=, edgecolor=, facecolor=, fill=, gid=, hatch=, hatch_linewidth=, height=, in_layout=, joinstyle=, label=, linestyle=, linewidth=, mouseover=, path_effects=, picker=, rasterized=, sketch_params=, snap=, transform=, url=, visible=, width=, zorder=)[source]#

Set multiple properties at once.

Supported properties are

set_angle(angle)[source]#

Set the angle of the ellipse.

Parameters:

anglefloat

set_center(xy)[source]#

Set the center of the ellipse.

Parameters:

xy(float, float)

set_height(height)[source]#

Set the height of the ellipse.

Parameters:

heightfloat

set_width(width)[source]#

Set the width of the ellipse.

Parameters:

widthfloat

property width#

Return the width of the ellipse.

Examples using matplotlib.patches.Ellipse#