我试着用 ggflowchart 重现楼主的结果,可是总是差点意思。
library(ggflowchart)
library(ggplot2)
data = data.frame(
from = c("A", "B", "B"),
to = c("B", "C", "D")
)
node_data = data.frame(
name = c("A", "B", "C", "D"),
label = c(
"节点1",
"第一行\n第二行\n第三行",
"改变字号",
"加粗 斜体"
),
type = c("A", "B", "C", "D")
)
ggflowchart(
data = data,
node_data = node_data,
fill = type,
color = c(
"#ffc0cb",
"#90ee90",
"#ececff",
"#add8e6"
),
text_size = c(4, 4, 3, 4),
x_nudge = 0.1,
y_nudge = 0.2,
horizontal = TRUE
) +
theme(legend.position = "none")