透明的背景为所有数字在Zeroir Rmd

8yoxcaq7  于 9个月前  发布在  其他
关注(0)|答案(1)|浏览(83)

如何在Rmd文件中为我所有的图片(baseggplot2)设置透明背景?我目前的设置非常简单。相关的标题部分是:

---
...
output:
    powerpoint_presentation:
        reference_doc: template.pptx
–-

字符串
knitr设置如下:

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo=TRUE, results='markup')
options(width=80, show.signif.stars=FALSE)
dsekswqp

dsekswqp1#

经过一番搜索,我找到了解决方案。knitr设置应该包括:

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo=TRUE, results='markup')

# set transparent background in base
knitr::opts_chunk$set(dev.args=list(bg='transparent'))

# set transparent background in ggplot
ggplot2::theme_set(ggplot2::theme_bw(base_size=12))
ggplot2::theme_update(panel.background=ggplot2::element_blank(),
    plot.background=ggplot2::element_blank(),
    legend.background=ggplot2::element_blank())

options(width=80, show.signif.stars=FALSE)
字符串

相关问题