DescTools (version 0.99.11)

DrawAnnulus: Draw One or Several Annuli

Description

Draw an annulus (or a sequence of annuli) with given center coordinates, fill and border colors on an existing plot using classical graphics.

Usage

DrawAnnulus(x = 0, y = x, radius.in = 1, radius.out = 2, nv = 100, 
            border = par("fg"), col = par("bg"), lty = par("lty"), 
            lwd = par("lwd"), plot = TRUE)

Arguments

x, y
a vector (or scalar) of xy-coordinates of the center(s).
radius.in
a vector (or scalar) of the inner radius of the annulus(i).
radius.out
a vector (or scalar) of the outer radius of the annulus(i).
nv
number of vertices to draw the circles. Default is 100.
border
color for the border(s). The default is par("fg"). Use border = NA to omit borders. If there are shading lines, border = TRUE means use the same colour for the border as for the shading lines.
col
color(s) to fill or shade the annulus with. The default NA (or also NULL) means do not fill, i.e., draw transparent rectangles, unless density is specified.
lty
line type for borders and shading; defaults to "solid".
lwd
line width for borders and shading.
plot
logical. If TRUE the structure will be plotted. If FALSE only the xy-points are calculated and returned. Use this option if you want to combine several geometric structures to a single polygon.

Value

  • DrawAnnulus invisibly returns a list of the calculated coordinates for all shapes.

Details

All geometric arguments are recycled if necessary.

See Also

polygon, DrawRegPolygon, DrawCircle, DrawArc

Examples

Run this code
Canvas(0.5)
DrawRegPolygon(nv=4, rot=pi/4, col="lightblue")
DrawAnnulus(radius.in=0.3, radius.out=0.45, col="lightgrey", border="darkgrey", lwd=5)

Run the code above in your browser using DataLab