【发布时间】:2016-10-17 00:35:24
【问题描述】:
对于 pdf 图形,fig.width 和 fig.height 块选项只会改变我的 word 文档中 2"x2" 图形的比例。我似乎无法控制 pdf 图形的大小,因为我可以使用从 R Markdown 编织成 word 文档的 png 图形。
---
title: "Controlling PDF figure size in MS Word output"
output: word_document
---
```{r global_options, include=FALSE}
knitr::opts_chunk$set(fig.path='02_Figs/', fig.show='asis', dev = 'pdf',
include=FALSE, warning=FALSE, message=FALSE)
```
# Fig. 1. Small Plot
```{r include=TRUE, echo=FALSE, fig.width=2, fig.height=3, fig.keep='high'}
with(mtcars, plot(mpg~wt))
```
# Fig. 2. Big Plot
```{r include=TRUE, echo=FALSE, fig.width=4, fig.height=6, fig.keep='high'}
with(mtcars, plot(mpg~wt))
```
【问题讨论】: