3D饼图:传说太大了

时间:2017-09-06 15:17:58

标签: r

传说的问题太大了。 当我改变cex的数量时,字体太小而且盒子仍然很大。 我希望盒子和测试可以匹配。它们不会太小和大。

table <- data.frame(num = c(90, 26, 28, 39, 98),
                            countries = c("India","Sri Lanka","Nepal","Bhutan", "China"))
label <-paste(table[,1],"%",sep="")
pie3D(table$num, labels = label, main = "Chart",radius = 1, explode = 0)
par(xpd = TRUE)
legend(1, 0.7, legend = table$countries, cex=0.7, yjust=0.6, xjust = -0.1, 
       fill = heat.colors(length(table$num)))    

enter image description here

1 个答案:

答案 0 :(得分:1)

您可以使用图片的pointsize或分辨率(widthheight)。你也可以适应labelcex

bmp("plot.bmp", height=600, width=800, pointsize = 15)

pie3D(table$num,labels=label,main="Chart",radius = 1,explode = 0, labelcex=1)
par(xpd=TRUE)
legend(1,0.7,legend=table$countries,cex=0.7,yjust=0.2, xjust = -0.1,
       fill = heat.colors(length(table$num)))  

dev.off()

enter image description here