roundrect: adds a rounded rectangular box to a plot

Description Usage Arguments Details Author(s) Examples

View source: R/roundrect.R

Description

adds a rectangular box with rounded left and right edges to a plot

Usage

1
2
roundrect(mid, radx, rady, rx = rady, dr = 0.01, 
          col = "white", lcol = "black", lwd = 2, angle = 0, ...)

Arguments

mid

midpoint (x,y) of the box.

radx

horizontal radius of the box.

rady

vertical radius of the box.

rx

radius of rounded part.

dr

size of segments, in radians, to draw the rounded line (decrease for smoother).

col

fill color of the box.

lcol

line color surrounding box.

lwd

line width of line surrounding the box.

angle

rotation angle, degrees.

...

arguments passed to function filledshape.

Details

radx and rady are the horizontal and vertical radiusses of the box; rx is the horizontal radius of the rounded part.

Here horizontal and vertical denote the position BEFORE rotation.

Author(s)

Karline Soetaert <karline.soetaert@nioz.nl>

Examples

1
2
3
4
5
6
emptyplot(c(-0.1, 1.1), main = "roundrect")
for (i in 1:10) 
  roundrect(mid = runif(2), col = i, radx = 0.1, rady = 0.05)
for (i in 1:5)
  roundrect(mid = runif(2), col = greycol(20), radx = 0.05,
            rady = 0.05, angle = runif(1)*360)

Example output



shape documentation built on May 4, 2021, 3 p.m.