gpt4 book ai didi

r - 如果横向太长,Bookdown 图标题会失败?

转载 作者:行者123 更新时间:2023-12-01 13:19:27 24 4
gpt4 key购买 nike

我有一个足够大的情节,需要在 RStudio 中使用 (PDF) bookdown 在其他肖像文档中绘制风景。这个图有很多事情要做,所以图标题很长,我真的不能再缩小文本了。

这是我一直在使用的示例代码:

```{r qtl-pleiotropy, out.extra='angle=90', fig.width=25/2.54, fig.height=16.9/2.54, 
fig.cap="QTL for fruit number per reproductive plant (Fruits/RP), seed number per fruit (Seeds/fr), seed number per reproductive plant (Seeds/RP), seed mass (Sd mass) and survival (Surv). Arrows indicate most-likely QTL position with the 95% Bayesian credible intervals, and the effect of the Swedish genotype (upward: increased phenotype; downward: decreased phenotype) in Italy (red) and Sweden (blue). Open arrows show QTL with credible intervals >15.2cM. Labels on the right of chromosome indicate QTL with pleiotropic effects on components of fecundity (c), fecundity and survival (s) and fecundity and seed mass (m). Grey boxes indicate the range of colocalising QTL for a single trait across site-year combinations."}
hist(rnorm(100)
```

问题是这会输出一个风景图,但标题在 PDF 输出中呈现为正文文本(即不是作为图形标题):

\begin{figure} \caption{QTL for fruit number per reproductive plant (Fruits/RP), seed number per fruit (Seeds/fr), seed number per reproductive plant (Seeds/RP), seed mass (Sd mass) and survival (Surv). Arrows indicate most-likely QTL position with the 95% Bayesian credible intervals, and the effect of the Swedish genotype (upward: increased phenotype; downward: decreased phenotype) in Italy (red) and Sweden (blue). Open arrows show QTL with credible intervals >15.2cM. Labels on the right of chromosome indicate QTL with pleiotropic effects on components of fecundity (c), fecundity and survival (s) and fecundity and seed mass (m). Grey boxes indicate the range of colocalising QTL for a single trait across site-year combinations.} \end{figure}



如果我不使用横向(即省略 out.extra='angle=90' ),这有效。如果我使用较短的标题块,它也会正确呈现。这有效,例如:
```{r qtl-pleiotropy, out.extra='angle=90', fig.width=25/2.54, fig.height=16.9/2.54, 
fig.cap="Open arrows show QTL with credible intervals >15.2cM. Labels on the right of chromosome indicate QTL with pleiotropic effects on components of fecundity (c), fecundity and survival (s) and fecundity and seed mass (m). Grey boxes indicate the range of colocalising QTL for a single trait across site-year combinations."}
hist(rnorm(100))
```

out.extra='angle=90' 时,字幕长度是否有上限? ?

任何人都可以为此提出解决方法吗?

最佳答案

问题不是由标题的长度引起的,而是由未转义的 % 引起的。 .以下对我有用:

```{r qtl-pleiotropy1, out.extra='angle=90', fig.width=25/2.54, fig.height=16.9/2.54, fig.cap="QTL for fruit number per reproductive plant (Fruits/RP), seed number per fruit (Seeds/fr), seed number per reproductive plant (Seeds/RP), seed mass (Sd mass) and survival (Surv). Arrows indicate most-likely QTL position with the 95\\% Bayesian credible intervals, and the effect of the Swedish genotype (upward: increased phenotype; downward: decreased phenotype) in Italy (red) and Sweden (blue). Open arrows show QTL with credible intervals >15.2cM. Labels on the right of chromosome indicate QTL with pleiotropic effects on components of fecundity (c), fecundity and survival (s) and fecundity and seed mass (m). Grey boxes indicate the range of colocalising QTL for a single trait across site-year combinations."}
hist(rnorm(100))
```

关于r - 如果横向太长,Bookdown 图标题会失败?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51154460/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com