draw.arc | R Documentation |
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.
draw.arc(x, y, theta0, theta1, r0, r1 = NA, n = 64, ...)
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 |
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.