1

pie3D我正在使用from plotrixpackage绘制一个 3D 饼图:

dev.new(width=6, height=5)
pie3D(weights, radius = 0.8, labels=paste(names(weights), labels, sep = "\n"), explode=0.05, mar=c(4, 4, 4, 4), border = F, col = my.col, main="Asset Allocation", labelcex = 0.8, shade = 0.5)

我得到以下信息:

在此处输入图像描述

如您所见,标签彼此重叠。我尝试修改mar输入(边距),但效果不佳。有没有办法增加图表上标签之间的间距,从而减少卡顿?请记住,我希望图形的半径保持固定在 0.9

谢谢!

4

1 回答 1

3

我猜你正在寻找pie3D.labels. 例如:

library(plotrix)

vec <- sample(1:10)
labs <- paste('piece \n no', 1:10, sep = " ")

par(mfrow = c(2,1))
a <- pie3D(vec, radius = 0.8, explode = 0.05, mar = c(1,1,1,1))
pie3D.labels(a, radius = 0.8, labels = labs, labelcex = 0.7)

b <- pie3D(vec, radius = 0.8, explode = 0.05, mar = c(1,1,1,1))
pie3D.labels(sample(seq(0, 2*pi, 0.1), 10), radius = 0.8, labels = labs, labelcex = 0.7)

剧情:

pie3d

于 2013-10-18T17:12:23.380 回答