par(mfrow=c(1,2))
angles <- seq( 0,2 * pi, pi/4) # the angles
mycol <- rainbow(8) # colors of the sector annuli
d <- 0.1 # the gap between the sectors in radians
plot(1:10, type="n", asp=1, xlab="", ylab="")
res <- sapply( 1:(length(angles)-1),
function(i) DrawAnnulusSector(x = 6, y = 6, radius.in = 2, radius.out = 3,
angle.beg = angles[i] + d/2, angle.end = angles[i+1] - d/2, col = mycol[i])
)
# Produce a clockplot
x <- c(15,9,75,90,1,1,11,5,9,8,33,11,11,20,14,13,10,28,33,21,24,25,11,33)
# plot clockwise, starting from 12 o'clock
angles <- (rev(seq(0,2*pi, pi/12) + pi/2))
Canvas(xlim=c(-100,100), main="Number of visitors to web site for each hour of a day")
PolarGrid(nr=c(0,90), ntheta=24, rlabels=NA, alabels=c(6:0, 23:7) )
DrawAnnulusSector(radius.in=0, radius.out=x, angle.beg = angles[-1],
angle.end = angles[-length(angles)], col=rainbow(24))
Run the code above in your browser using DataLab