TITLE(rect @@ Draw a Rectangle)
USAGE(
rect(xleft, ybottom, xright, ytop, DOTS)
)
ALIAS(rect)
ARGUMENTS(
ARG(xleft @@ a vector (or scalar) of left x positions.)
ARG(ybottom @@ a vector (or scalar) of bottom y positions.)
ARG(xright @@ a vector (or scalar) of right x positions.)
ARG(ytop @@ a vector (or scalar) of top y positions.)
ARG(DOTS @@ graphical parameters passed to set.pars.)
)
DESCRIPTION(
LANG(rect) draws a rectangle (or sequence of rectangles) with the
given coordinates. It is a primitive function used in LANG(LINK(hist)).
The value supplied, i.e., LANG(xleft, DOTS), are relative to the current
plotting region. If the x-axis goes from 100 to 200 then LANG(xleft)
must be larger than 100 and LANG(xright) must be less than 200.
)
SEEALSO(
LANG(LINK(box)) for the "standard" box around the plot;
LANG(LINK(polygon)) and LANG(LINK(segments)) for flexible line drawing.
)
EXAMPLES(
# set up the plot region but don't plot
plot(c(100, 200), c(300, 400), type="n")
BLANK
# draw a rectangle with bottom left (150,320)
# and top right (177,380)
rect(150,320, 177,380)
)
