我还有另一个非常基本的问题,需要使用 R 在四开本中引用图形,但我无法在网上找到答案。
所以,这是一个非常小的可重现示例;
---
title: "Untitled"
format: pdf
editor: visual
fig.cap: false
---
```{r fig-plot, warning=FALSE, message=FALSE, echo=FALSE}
library(tidyverse)
mtcars <- mtcars
ggplot(mtcars, aes(x = mpg, y = cyl)) +
geom_point()
As can be seen in @fig-plot
从输出中可以看出,图下方有一个文本,这是我不希望有的。我怎样才能删除它?感谢您事先的关注。
您的 reprex 缺少代码块上的关闭栅栏。修复此问题后,只需删除
fig
部分即可删除图下方的标题文本。你也不需要fig.cap: false
。
---
title: "Untitled"
format: pdf
editor: visual
---
library(tidyverse)
mtcars <- mtcars
ggplot(mtcars, aes(x = mpg, y = cyl)) +
geom_point()