Skip to content
Prev 369781 / 398503 Next

draw stripes in a circle in R

Agree that the coding question remains unclear, so not using the offered example but responding to the natural language query. The `polygon` function has 'density' and 'angle' argument that with 'col' and 'lwd' can make slanted fill lines. This is a modification of hte first example on `?polygon`?

x <- c(1:9, 8:1)
y <- c(1, 2*(5:3), 2, -1, 17, 9, 8, 2:9)
op <- par(mfcol = c(3, 1))
for(xpd in c(FALSE, TRUE, NA)) {
    plot(1:10, main = paste("xpd =", xpd))
    box("figure", col = "pink", lwd = 3)
    polygon(x, y, xpd = xpd, col = "orange", density=3, angle=45,  lwd = 5, border = "red")
}

The polygon function is _not_ in pkg::plotrix.
David Winsemius
Alameda, CA, USA