这是我之前问题的第二部分(在使用R中的atop函数时如何获得恒定的文本大小)。
现在的问题是如何防止
(不幸的是,如果您的建议是将
有什么建议吗?
现在的问题是如何防止
plotmath
将文本居中以避免额外的间距(在此处用黄色突出显示)。我想要所有内容都靠右对齐。(不幸的是,如果您的建议是将
substitute
替换为expression
,我无法这样做。)有什么建议吗?
library(ggplot2)
ggplot(iris, aes(Species, Sepal.Length)) +
geom_boxplot() +
labs(caption = substitute(atop(
atop(
displaystyle("layer1 is small"),
displaystyle("layer2 is a bit longer")
),
"layer3 is super-duper longgggggggg"
)))
expression
来创建标题,而我正在使用substitute
。提供的解决方案当然不适用于substitute
。(如果你想知道为什么如此着迷于substitute
,这就是我使用它的上下文- https://github.com/IndrajeetPatil/ggstatsplot/blob/c07736cc4abfc81430b3e725e57a60b883a444d9/R/helpers_ggbetween_subtitles.R#L167-L231) - Indrajeet Patil