# 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:
    center array

      Center of the rectangle

    color instance of Color

      The fill color to use.

    border_color instance of Color

      The border color to use.

    border_width int

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

    height float

      Length of the rectangle along y-axis Defaults to 1.0

    width float

      Length of the rectangle along x-axis Defaults to 1.0

    radius float | array

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

    **kwargs dict

      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.

previous

vispy.visuals.polygon module

next

vispy.visuals.regular_polygon module