生信人

找回密码
立即注册
搜索
热搜: 活动 交友 discuz
发新帖

0

收听

12

听众

318

主题
发表于 2022-9-14 10:15:14 | 查看: 1162| 回复: 0
  1. x <- read.csv("homo_length.csv",header = T)
  2. x <- x[1:24,]
  3. barplot(height = x$length,names.arg = x$chr)
  4. pie(x$length/sum(x$length))

  5. m <- read.table("Species.txt");
  6. m
  7. x <- m[,3]
  8. pie(x);
  9. # colours()
  10. # sample(colours(),7)
  11. # rainbow(7)
  12. pie(x,col=rainbow(length(x)))
  13. lbls <- paste(m[,1],m[,2],"\n",m[,3],"%" )
  14. pie(x,col=rainbow(length(x)),labels = lbls)
  15. pie(x,col=rainbow(length(x)),labels = lbls,radius = 1)
  16. pie(x,col=rainbow(length(x)),labels = lbls,radius = 1,cex=0.8)

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

  24. #扇形图
  25. fan.plot(x,col=rainbow(length(x)),labels = lbls,cex=0.8,radius = 1)
复制代码

3D饼图

扇形图

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

您需要登录后才可以回帖 登录 | 立即注册

QQ|Archiver|手机版|小黑屋|生信人 ( 萌ICP备20244422号 )

GMT+8, 2024-11-23 21:34 , Processed in 0.082692 second(s), 31 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表