draw.arc: draw.arc

View source: R/common.R

draw.arcR Documentation

draw.arc

Description

draw.arc draws an annular sector around origin (x,y) as a polygon. If only one radius argument is given, then draw.arc will render an arc instead of an annular sector.

Usage

draw.arc(x, y, theta0, theta1, r0, r1 = NA, n = 64, ...)

Arguments

x:

x-coordinate of origin

y:

y-coordinate of origin

theta0:

start angle of arc

theta1:

end angle of arc

r0:

radius to inner arc

r1:

radius to outer arc (optional, draw line if omitted)

n:

number of points to interpolate curves

Examples

# create plot region
par(mar=c(1,1,1,1))
plot(NA, xlim=c(-1, 1), ylim=c(-1, 1), bty='n' , xaxt='n', yaxt='n')
# draw annular sector as filled polygon
draw.arc(0, 0, theta0=0.7*pi, theta1=1.1*pi, r0=0.5, r1=0.8, col='steelblue')
# draw arc with custom line style
draw.arc(0, 0, theta0=0, theta1=0.7*pi, r0=0.65, col='black', lwd=2, lty=3)


ArtPoon/ggfree documentation built on July 11, 2024, 11:15 a.m.