Skip to content

rectangle

plot · scripts/plot/draw/rectangle.m

: h = rectangle ()
: h = rectangle ("Position", [x y w h])
: h = rectangle (…, "Curvature", c)
: h = rectangle (…, prop, val)
: h = rectangle (ax, …)

Add a rectangle, rounded rectangle or ellipse to the axes.

Position is [x y width height] (default [0 0 1 1]). Curvature is a pair [cx cy] in the range 0 to 1 giving the relative rounding of the corners; [1 1] yields an ellipse. A scalar curvature applies to both directions. Further properties are FaceColor (default "none"), EdgeColor, LineStyle and LineWidth.

The shape is added to the current axes without clearing it.