R语言绘制五颜六色的商业饼图

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")

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值