par(mfrow=c(2,2))
slices<-c(10,12,4,16,8)
lbls<-c("美国","中国","俄罗斯","德国","英国")
pie(slices,labels=lbls,main="简单饼图",
col = c("aliceblue","aquamarine","azure","blueviolet","chartreuse"))
pct<-round(slices/sum(slices)*100)
lbls2<-paste(lbls,"",pct,"%",sep="")
pie(slices,labels=lbls2,main="带有百分比的饼图",
col = c("aliceblue","aquamarine","azure","blueviolet","chartreuse"))
library(plotrix)
pie3D(slices,labels=lbls,explode=0.1,main="3D饼图",
col = c("aliceblue","aquamarine","azure","blueviolet","chartreuse"))
mytable<-table(state.region)
lbls3<-paste(names(mytable),"\n",mytable,sep="")
pie(mytable,labels=lbls3,main="从一张表绘制饼图\n(带有采样尺寸)",
col = c("aliceblue","aquamarine","azure","blueviolet","chartreuse"))
col = c("azure","cadetblue","beige","brown","blue"))
col = c("chocolate","cadetblue","beige","brown","chartreuse")
col = c("darkgray","cyan","darkblue","darkcyan","darkgoldenrod")
col = c("darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange")
col = c("darkorchid","darkred","darksalmon","darkseagreen","darkslateblue")
col = c("darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue")
col = c("dimgray","dodgerblue","firebrick","forestgreen","gold")
col = c("goldenrod","gray","green","greenyellow","hotpink")