In the MWE below, the caption appears separated into two rows. I want the item corresponding to gear 5 to be aligned in the middle in relation to gears 3 and 4 above it.
How can I do this?
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))
[EDIT]
I want the plot to look like this:

