饼图以及扇形图

2022-10-25 19:55:17 浏览数 (1)

代码语言:javascript复制
x <- read.csv("homo_length.csv",header = T)
x <- x[1:24,]
barplot(height = x$length,names.arg = x$chr)
pie(x$length/sum(x$length))

m <- read.table("Species.txt");
m
x <- m[,3]
pie(x);
# colours()
# sample(colours(),7)
# rainbow(7)
pie(x,col=rainbow(length(x)))
lbls <- paste(m[,1],m[,2],"n",m[,3],"%" )
pie(x,col=rainbow(length(x)),labels = lbls)
pie(x,col=rainbow(length(x)),labels = lbls,radius = 1)
pie(x,col=rainbow(length(x)),labels = lbls,radius = 1,cex=0.8)

#3D饼图
#install.packages("plotrix")
library(plotrix)
pie3D(x,col=rainbow(length(x)),labels = lbls)
pie3D(x,col=rainbow(length(x)),labels = lbls,cex=0.8)
pieplot <- pie3D(x,col=rainbow(length(x)),radius = 1,explode = 0.05,labels = lbls)
# pie3D.labels(pieplot,labels = lbls,labelcex = 0.8,height = 0.1,labelrad = 1.75)

#扇形图
fan.plot(x,col=rainbow(length(x)),labels = lbls,cex=0.8,radius = 1)

饼图

扇形图

写在最后:有时间我们会努力更新的。大家互动交流可以前去论坛,地址在下面,复制去浏览器即可访问,弥补下公众号没有留言功能的缺憾。原地址暂未启用(bioinfoer.com)。

代码语言:javascript复制
sx.voiceclouds.cn

有些板块也可以预设为大家日常趣事的分享等,欢迎大家来提建议。

0 人点赞