With layout(), I think, you can limit the margin change a bit to compress the pie charts together.
, . pie() xlim. .
, pie :
xlim <- ylim <- c(-1, 1)
xlim, .
mypieleft() mypieright().
mypieleft<-function(blah blah){
[untouched code from pie]
xlim <- c(-1.20, 0.80)
ylim <- c(-1, 1)
[untouched code from pie]
}
mypieright<-function(blah blah){
[untouched code from pie]
xlim <- c(-0.75, 1.25)
ylim <- c(-1, 1)
[untouched code from pie]
}
:
layout(matrix(c(1,2,3,3), ncol=2, byrow=TRUE), heights=c(4, 1))
par(oma=c(0,0,0,0), xpd=TRUE)
mypieleft(c(1,9),col=c("black","white"))
mypieright(c(1,3),col=c("black","white"))
plot.new()
legend(x="center", ncol=2,legend=c("Black","Whtie"),fill=c("black","white"), bty = "n",cex=1.3)
.
