
Draw a single rectangle with rounded corners.
roundrectGrob(x=0.5, y=0.5, width=1, height=1,
default.units="npc",
r=unit(0.1, "snpc"),
just="centre",
name=NULL, gp=NULL, vp=NULL)
grid.roundrect(...)
The location and size of the rectangle.
A string indicating the default units to use
if x
, y
, width
, or height
are only given as numeric vectors.
The radius of the rounded corners.
The justification of the rectangle relative to its location.
A name to identify the grob.
Graphical parameters to apply to the grob.
A viewport object or NULL
.
Arguments to be passed to roundrectGrob()
.
At present, this function can only be used to draw one rounded rectangle.
# NOT RUN {
grid.roundrect(width=.5, height=.5, name="rr")
theta <- seq(0, 360, length=50)
for (i in 1:50)
grid.circle(x=grobX("rr", theta[i]),
y=grobY("rr", theta[i]),
r=unit(1, "mm"),
gp=gpar(fill="black"))
# }
Run the code above in your browser using DataLab