data <- LETTERS[1:7]
num <- runif(7)
library(RColorBrewer)
col <- brewer.pal(11,'Dark2')[3:11]
## Warning in brewer.pal(11, "Dark2"): n too large, allowed maximum for palette Dark2 is 8
## Returning the palette you asked for with that many colors
pie(num,col = col,xaxt='n',labels=paste(id,':',round(num*1000)/100,'%',sep=''))
title(main = list('ZXCVBNM',cex=1.5),sub = Sys.Date())
col <- brewer.pal(11,'Set1')[3:11]
col <- brewer.pal(11,'Set2')[3:11]
col <- brewer.pal(11,'Set3')[3:11]
col <- brewer.pal(11,'Paired')[3:11]
col <- brewer.pal(11,'Dark2')[3:11]
col <- brewer.pal(11,'RdYlBu')[3:11]
col <- brewer.pal(11,'RdBu')[3:11]
col <- brewer.pal(11,'PuOr')[3:11]
col <- brewer.pal(11,'PRGn')[3:11]
col <- brewer.pal(11,'PiYG')[3:11]
col <- brewer.pal(11,'BrBG')[3:11]
col <- brewer.pal(11,'YlOrRd')[3:11]
col <- brewer.pal(11,'YlOrBr')[3:11]
col <- brewer.pal(11,'YlGnBu')[3:11]
col <- brewer.pal(11,'YlGn')[3:11]
col <- brewer.pal(11,'Reds')[3:11]
col <- brewer.pal(11,'RdPu')[3:11]
col <- brewer.pal(11,'Purples')[3:11]
col <- brewer.pal(11,'PuRd')[3:11]
col <- brewer.pal(11,'PuBuGn')[3:11]
col <- brewer.pal(11,'PuBu')[3:11]
col <- brewer.pal(11,'OrRd')[3:11]
col <- brewer.pal(11,'Oranges')[3:11]
col <- brewer.pal(11,'Greys')[3:11]
col <- brewer.pal(11,'Greens')[3:11]
col <- brewer.pal(11,'GnBu')[3:11]
col <- brewer.pal(11,'BuPu')[3:11]
col <- brewer.pal(11,'BuGn')[3:11]
col <- brewer.pal(11,'Blues')[3:11]
col <- brewer.pal(11,'RdYlBu')[3:11]
col <- brewer.pal(11,'RdBu')[3:11]
col <- brewer.pal(11,'PuOr')[3:11]
col <- brewer.pal(11,'PRGn')[3:11]
col <- brewer.pal(11,'PiYG')[3:11]
col <- brewer.pal(11,'BrBG')[3:11]
开发工具:RStudio 2022.12.0