Ind*_*til 5 r ggplot2 plotmath tidyverse
下面是我编写的复杂自定义函数的一个简单得多的示例。在这个函数的全长形式中,
"layer1"
对应于caption
用户输入, "layer2"
对应于统计测试的结果,并且 "layer3"
对应于有关执行的统计测试的详细信息。但是当所有三层都包含在标题中时,它看起来像这样 -
library(ggplot2)
ggplot(iris, aes(Species, Sepal.Length)) +
geom_boxplot() +
labs(caption = substitute(atop(substitute(
atop("layer1", "layer2")
)
, "layer3")))
Run Code Online (Sandbox Code Playgroud)
由reprex 包(v0.2.1)于 2018 年 11 月 9 日创建
所以我想找出一种方法可以使所有三层的文本大小保持不变。我实际上不确定为什么在这种情况下文本大小会自动更改。
有什么办法可以防止这种情况发生吗?
我对情节中的“替代品”有点困惑,但也许以下可以解决问题:
ggplot(iris, aes(Species, Sepal.Length)) +
geom_boxplot() +
labs(caption = substitute(atop(
atop(displaystyle("layer1"), displaystyle("layer2")), "layer3")))
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
301 次 |
最近记录: |