vispy.visuals.rectangle module#

Simple ellipse visual based on PolygonVisual

class vispy.visuals.rectangle.RectangleVisual(center=None, color='black', border_color=None, border_width=1, height=1.0, width=1.0, radius=[0.0, 0.0, 0.0, 0.0], **kwargs)#

Bases: PolygonVisual

Displays a 2D rectangle with optional rounded corners

Parameters:
centerarray

Center of the rectangle

colorinstance of Color

The fill color to use.

border_colorinstance of Color

The border color to use.

border_widthint

Border width in pixels. Line widths > 1px are only guaranteed to work when using border_method=’agg’ method.

heightfloat

Length of the rectangle along y-axis Defaults to 1.0

widthfloat

Length of the rectangle along x-axis Defaults to 1.0

radiusfloat | array

Radii of curvatures of corners in clockwise order from top-left Defaults to 0.

**kwargsdict

Keyword arguments to pass to PolygonVisual.

property center#

The center of the ellipse

property height#

The height of the rectangle.

property radius#

The radius of curvature of rounded corners.

property width#

The width of the rectangle.