Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

roundrect

adds a rounded rectangular box to a plot


Description

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

Usage

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

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)

shape

Functions for Plotting Graphical Shapes, Colors

v1.4.5
GPL (>= 3)
Authors
Karline Soetaert <karline.soetaert@nioz.nl>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.