由于添加了数字,图例有一半可见

due to the addition of numbers the legend is half visible

传说中有很长的文字。在我添加数字后,该文本是半可见的。 我的代码:

library(plotrix)
x <- c(16.6, 8.3, 11.7, 10.6,38.5,14.3)
lbls <- paste(x,"%") 
labels <- c("TEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXT", "TEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXT", "TEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXT", 
            "TEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXT", "TEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXT",
            "TEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXT")
colors<-c("#F69646","#B70000","#002060","#553C75","#632523","#00B0EF")
pie3D(x, labels=lbls,explode=0.1, height=0.05,  main='TEXTTEXTTEXTTEXTTEXTTEXT', col=colors)
legend(0.75,1.1, labels, cex = 0.46,fill = colors)

您需要调整一些图例参数,尤其是 xjustadj:

pie3D(x, labels = lbls, explode = 0.1, height = 0.05, 
      main = 'TEXTTEXTTEXTTEXTTEXTTEXT', col = colors, mar = c(2, 4, 4, 4))
legend(0.75, 0.7, labels, cex = 0.46, fill = colors, xjust = 0.16, 
       inset = 0, adj = c(1, 0))

我加

par(xpd=TRUE)

时间表和图例之间