在下面的 MWE 中,标题显示为分为两行。我希望与齿轮 5 相对应的项目相对于其上方的齿轮 3 和齿轮 4 在中间对齐。
我该怎么做?
library(ggplot2)
ggplot(data = mtcars,
aes(x = disp,
y = qsec,
shape = as.factor(gear),
color = as.factor(gear))) +
geom_line() +
geom_point() +
theme(legend.position = "bottom",
legend.title = element_blank()) +
guides(shape=guide_legend(nrow = 2,
byrow = TRUE),
color = guide_legend(nrow = 2,
byrow = TRUE))