Draw and Shade Rectangle(s)
DESCRIPTION:
draws rectangles as specified by the coordinates, border and fill color, and fill pattern.
USAGE:
rect(xleft, ybottom, xright, ytop,
density = NULL, angle = 45,
border = NULL, col = NA,
lty = par("lty"), lwd = par("lwd"), ...)
REQUIRED ARGUMENTS:
- xleft
-
the x left position.
- ybottom
-
the y bottom position.
- xright
-
the x right position.
- ytop
-
the y top position.
OPTIONAL ARGUMENTS:
- density
-
The number of hatch lines per inch. NULL or 0 means to not
draw hatch lines.
- angle
-
The direction of the hatch lines, in degrees counter-clockwise
from the positive x axis.
- border
-
The border line colors. As a special cases, NULL means par("fg"),
the foreground color, and NA means "transparent".
- col
-
The fill colors. NA means "transparent".
- lty
-
The line types of the border lines.
- lwd
-
The widths of the border lines.
- ...
-
Additional scalar graphical parameters.
DETAILS:
The position parameters can be vectors and will each be repeated
to the length of the longest position vector.
SEE ALSO:
,
,
,
EXAMPLES:
plot(1:6)
rect(1:4,1:4,1:4+1.4,1:4+1.2, border=c("red","orange","blue"),
lwd=3, col=(c("pink","yellow","lightblue","purple")))