【问题标题】:Size of plot in R-Markdown [duplicate]R-Markdown中的绘图大小[重复]
【发布时间】:2020-05-01 05:48:03
【问题描述】:

如何减小 R-Markdown 块中的绘图大小?我想渲染一个.pdf,但是图太大了。

ggplot(data = test_datac,repr.plot.width = 7, repr.plot.height = 4) + 
  geom_line(size=0.5,mapping = aes(x = Period, y = gdpg))

我尝试添加repr.plot.width = 7repr.plot.height = 4,但这并没有减小大小。

【问题讨论】:

  • 在你的块选项中设置它,例如{r, fig.height = 6, fig.width = 12}.

标签: r ggplot2 r-markdown


【解决方案1】:

您可以通过设置 fig.height=fig.width= 块参数来更改 R-Markdown 代码块中的底池大小:

```{r fig.height=8, fig.width=8}
ggplot(iris) + 
  geom_line(aes(x = Sepal.Length, y = Sepal.Width), size = 0.5)
```

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-04-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-15
    • 2019-03-09
    • 1970-01-01
    相关资源
    最近更新 更多