我想在word文档中添加一个图表.我希望该图可以在页面大小设置为合法且边距较窄时最大化可用区域.我可以设置fig.width和fig.height,但似乎图表会自动重新调整大小以适应具有正常边距的默认页面大小(字母).
这是一个示例.rmd文件,它产生相同的结果:
---
title: "plot-resize"
output: word_document
---
Plot with the height set to 3" and the width to 7.5":
```{r, echo = FALSE, fig.height=3, fig.width=7.5, warning=FALSE, message=FALSE}
plot(cars)
```
However when the word document is created the image is automatically
re-sized to 79% of this.
Run Code Online (Sandbox Code Playgroud)
我可以用字重新调整情节的大小,但不必这样做会很好.
有没有办法在.rmd文件中设置页面大小和边距?
有没有办法确保图表保持指定的大小,即使它们不适合创建的word文档的边距?