I am trying to adjust the piechart figure in my Rmarkdown document so that it spans the width of the page or at least becomes wide enough to fit all of the labels.
I have tried everything - adjusting figure.height
and figure.width
, margins with par(mar)
and par(oma)
, but nothing seems to work. Either the pies themselves become smaller, or the labels are even more cut off. I would like the pies to be as large as possible with clearly visible labels, but every time it renders small pies and tiny labels.
Is there a workaround at least so that labels are not cut off (or can overlap the adjacent chart)? Any suggestions would be appreciated.
```{r, figure.align = "center", figure.height = 10, figure.width = 12}
par(mfrow=c(1,3), cex.axis=1.5, cex.lab=1.5)
par(mar = c(4,2,4,2))
par(oma = c(3, 3, 3, 3))
pie(a, labels = lbls, font = 2, col = c("tomato", "white"), cex=2)
pie(b, lbls2, font = 2, col = c("tomato", "white"), cex=2)
mtext(side=3, text="Plan Breakdown: Top 20% of Users")
pie(c, lbls3, font = 2, col = c("tomato", "white"))
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…