【发布时间】:2019-04-05 22:53:27
【问题描述】:
我正在尝试让我的数字字幕正常工作,但我遇到了一些问题。要么我的字幕无法正常工作,要么我的标题将显示在图下方。
我尝试过将 \newpage、\pagebreak、\ 在所有可能的位置、fig.pos、fig.height 和 fig.width 上,但似乎没有任何效果。无法同时显示标题和图上的标题。
这是我的代码:
output: pdf_document
fig_caption: yes
graphics: yes
keep_tex: yes
---
### Header(Will get under the plot in the pdf)
```{r plot, fig.cap="Hello World!"}
ggplot(data, aes(x=x, y=y)) + geom+point()
```
Text text text text text text text
会话信息()
R version 3.4.2 (2017-09-28)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS 10.14
Matrix products: default
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggfortify_0.4.6 ggplot2_2.2.1 dplyr_0.7.4 knitr_1.17 pxweb_0.9.1
loaded via a namespace (and not attached):
[1] Rcpp_0.12.13 bindr_0.1 compiler_3.4.2 highr_0.6 plyr_1.8.4 tools_3.4.2
[7] digest_0.6.18 gtable_0.2.0 jsonlite_1.5 evaluate_0.10.1 tibble_1.3.4 checkmate_1.8.5
[13] viridisLite_0.2.0 pkgconfig_2.0.1 rlang_0.1.4 rstudioapi_0.7 curl_3.1 yaml_2.1.14
[19] bindrcpp_0.2 gridExtra_2.3 httr_1.3.1 stringr_1.2.0 xml2_1.2.0 hms_0.4.2
[25] grid_3.4.2 rprojroot_1.3-2 webshot_0.5.1 glue_1.2.0 data.table_1.10.4-3 R6_2.2.2
[31] rmarkdown_1.8 RJSONIO_1.3-0 purrr_0.2.4 tidyr_0.7.2 readr_1.1.1 magrittr_1.5
[37] backports_1.1.1 scales_0.5.0 htmltools_0.3.6 assertthat_0.2.0 rvest_0.3.2 colorspace_1.3-2
[43] stringi_1.1.6 lazyeval_0.2.1 munsell_0.4.3
【问题讨论】:
标签: r r-markdown