服务热线
178 0020 3020
x <- read.csv('/Users/taowang/documents/R/GDP.csv')
head(x)
GDP <- x[,-1]
head(GDP)
pdf(file = "pie1.pdf")
pie(GDP)
dev.off()
pdf(file = "pie2.pdf")
pie(GDP,labels = '')
dev.off()
pdf(file = "pie3.pdf")
pie(GDP,labels = '',radius = 1)
dev.off()
pdf(file = "pie4.pdf")
pie(GDP,labels = '',radius = 1, col = rainbow(31))
dev.off()
pdf(file = "pie5.pdf")
pie(GDP,labels = '',radius = 1, col = rainbow(31), clockwise = T)
dev.off()
pdf(file = "pie6.pdf")
pie(GDP,labels = '',radius = 1, col = rainbow(31), clockwise = T, init.angle = 45)
dev.off()
pdf(file = "pie7.pdf")
pie(GDP,labels = '',radius = 1,
col = rainbow(31), clockwise = T,
density = 10,
angle = 10*0:30
)
dev.off()
pdf(file = "pie8.pdf")
pie(GDP,labels = '',radius = 1,
col = rainbow(31), clockwise = T,
init.angle = 45,
main = 'GDP'
)
dev.off()
pdf(file = "pie9.pdf",8,6)
pie(GDP,labels = '',radius = 1,
xlim = c(0,6),
ylim = c(0,6),
col = rainbow(31), clockwise = T,
init.angle = 45,
main = 'GDP'
)
legend('topright', legend = x$X, fill = rainbow(31),
cex = 0.65
)
dev.off()
library(plotrix)
pdf(file = "pie3D-1.pdf")
pie3D(GDP,radius = 1, height = 0.2,
main = 'GDP'
)
dev.off()
pdf(file = "pie3D-2.pdf")
pie3D(GDP,radius = 1, height = 0.2,
main = 'GDP'
)
legend('topright', legend = x$X, fill = rainbow(31),
cex = 0.65
) #legend不会调整
dev.off()
install.packages('VennDiagram')
library(VennDiagram)
library(grid)
library(futile.logger)
set.seed(1001)
x1 <- sample(1:100,50,replace = T)
set.seed(1002)
x2 <- sample(1:100,50,replace = T)
set.seed(1003)
x3 <- sample(1:100,50,replace = T)
T <- venn.diagram(list(A=x1,B=x2,C=x3),filename = 'venn.tiff',lwd=1,lty=2,col=rainbow(3),
fill=rainbow(3),cat.col=rainbow(3))
grid.draw(T)
附件