plot.new()中出错:R标记中的数字边距过大

  • 本文关键字:数字 new 出错 plot r r-markdown
  • 更新时间 :
  • 英文 :


当试图在r Markdown中绘制热图时,我可以生成一个html文件,但每次我的pdf文件都会因为页边空白过大而失败。

下方显示了可重新生成的代码部分,包括前导码等

---
title: "Untitled"
output:
bookdown::html_document2: 
theme: darkly
bookdown::pdf_document2:
keep_tex: TRUE
number_sections: TRUE
toc: FALSE
fontsize: 11pt
knit: (function(inputFile, encoding) {
rmarkdown::render(inputFile, encoding = encoding,
output_format = "all") })
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
knitr::opts_chunk$set(results = 'hide')
knitr::opts_chunk$set(warning = FALSE)
knitr::opts_chunk$set(fig.pos = 'H')
knitr::opts_chunk$set(fig.align = 'center')
knitr::opts_chunk$set(cache=TRUE)
```
## R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r cars}
x = matrix(runif(400), ncol = 20)
heatmap3::heatmap3(x)
```

到目前为止,我已经将par(mar)设置为从c(1,1,1,1)c(10,10,10,10)的广泛数字,以及heatmap3命令中的margin命令,所有这些都失败了。

如有任何建议,不胜感激。请注意,这不是标准";数字边距过大";错误,因为它仅本地化为pdf,但可以作为html或仅在控制台中正常工作。

只需包括:

par(mar = c(0, 0, 0, 0))

相关内容

最新更新