library(tidyverse)
data <- tibble(
name = c("AAA", "BBB"),
value = c(0.3, 0.2)
)
str_stack <- function(x) {
x %>% str_split("") %>% map(~ .x %>% paste(collapse = "\n"))
}
data %>%
ggplot(aes(name, value)) +
geom_col() +
scale_x_discrete(label = str_stack)
Run Code Online (Sandbox Code Playgroud)

由reprex 包于 2022 年 4 月 5 日创建(v2.0.0)