# Bar-Pie Chart x <- c(434,443,101,50,20,30) colores <- 2:7 angles <- x/sum(x)*pi # in radians angle.start <- c(0,cumsum(angles)) plot(x, type="n", xlim=c(-6,6), ylim=c(-1,6), xaxt="n",yaxt="n",xlab="", ylab="" , bty="n") plot.segment(angle.start, lwd=1, colores=colores) plot.segment <- function(angles,colores=1, dens=0.01, lwd=2, r.inner=1, thickness=1) { n.ang <- length(angles)-1 if( length(colores)!=1 ) { colores <- rep(colores,n.ang) } else { colores <- 1:n.ang } for(i in 1:n.ang ) { a.start <- angles[i] a.stop <- angles[i+1] col <- colores[i] theta.o <- seq(a.start,a.stop,dens) theta.i <- seq(a.stop,a.start,-dens) x.outer <- cos( theta.o )*(r.inner+thickness) y.outer <- sin( theta.o )*(r.inner+thickness) x.inner <- cos( theta.i )*(r.inner) y.inner <- sin( theta.i )*(r.inner) polygon(c( x.outer, x.inner) ,c(y.outer,y.inner), col=col, lwd=lwd) } }