I试图将多个图(子图)插入四分位数以进行
pdf
输出。我不是在代码中生成图,而是导入.png
文件来生成图形。
我以两种方式尝试了,但这并没有成功。有没有办法在四分之一中实现这一目标?
贝洛是我不成功的例子:
使用
knitr::include_graphics
#| label: myplot2
#| layout: [[1,1],[1,1]]
#| out-width: "250px"
#| fig-show: "hold"
#| fig-cap: Myplot
#| fig-subcap:
#| - "a"
#| - "b"
#| - "c"
#| - "d"
#| echo: false
#| warning: false
#| message: false
knitr::include_graphics(c(fig1, fig2, fig3, fig4))
#| label: myplot2
#| layout: [[1,1],[1,1]]
#| out-width: "250px"
#| fig-show: "hold"
#| fig-cap: Myplot
#| fig-subcap:
#| - "a"
#| - "b"
#| - "c"
#| - "d"
#| echo: false
#| warning: false
#| message: false
knitr::include_graphics(fig1)
knitr::include_graphics(fig2)
knitr::include_graphics(fig3)
knitr::include_graphics(fig4)
这种方法不会生成4个数字,而只生成1.
使用div
::: {#fig-subplots layout="[[1,1],[1,1]]"}




Myplot
:::
wiver您已经创建了图,并且只想包含PNG图像,您可以使用图形指令。
::: {#fig-myplot layout-ncol=2}




Myplot
:::
更多详细信息,请访问