使用时如何完全左对齐文本atop()
?
library(tidyverse)
mtcars %>%
mutate(cyl = str_c("atop(bold(", cyl, "~long~text~on~the~top),(shorttext))")) %>%
ggplot(aes(hp, wt)) +
geom_line() +
facet_wrap(~cyl, labeller = label_parsed) +
theme(strip.text.x = element_text(hjust = 0))
现在我肯定会用奇妙的方式来回答这个问题ggtext
package
library(tidyverse)
library(ggtext)
mtcars %>%
mutate(cyl = str_c("**", cyl, " long text on the top**<br>(shorttext)")) %>%
ggplot(aes(hp, wt)) +
geom_line() +
facet_wrap(~cyl) +
theme(strip.text.x = element_markdown(hjust = 0))
Created on 2021-01-03 by the reprex package https://reprex.tidyverse.org (v0.3.0)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)