【发布时间】:2017-08-28 23:35:50
【问题描述】:
我正在尝试调整我的 Rmarkdown 文档中的饼图,使其跨越页面的宽度,或者至少变得足够宽以适合所有标签。
我已经尝试了所有方法 - 调整 figure.height 和 figure.width,使用 par(mar) 和 par(oma) 调整边距,但似乎没有任何效果。要么馅饼本身变小,要么标签被切断更多。我希望馅饼尽可能大,标签清晰可见,但每次它都会渲染小馅饼和小标签。
是否有一种解决方法至少可以使标签不被切断(或可以与相邻图表重叠)?任何建议,将不胜感激。
```{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"))
【问题讨论】:
-
你能提供你正在使用的整个 Rmd 吗?您使用的是哪种输出格式?
标签: r r-markdown pie-chart figure