您可以将一个部分细分为多个部分,并将一个颜色从一个比例应用到每个部分.它需要为外圆绘制一条线,在圆形调用中将其删除.
# Number of intervals to subdivide - increase for finer detail
n <- 41
# Generate colours
cols <- colorRampPalette(c("white", "black"))(n)
# Plot
# lty=0 removes the section lines, which also removes outer border
pie(c(1,2, rep(1/n, n)), col=c("black","white", cols) , lty=0,
labels=c(1,2, rep("", n/2), 3))
# Add in outer circle back in
# radius=0.8 used as this is the pie default
plotrix::draw.circle( 0,0, 0.8)
Run Code Online (Sandbox Code Playgroud)
这使