ggplot legend position
11:40 04 Jan 2026

Assume my plot looks like:

data("mtcars")


ggplot(mtcars, aes(x = drat, y = cyl,
                   color = disp,
                   fill = wt, size = mpg))+
  geom_line()+
  geom_point(data =mtcars, aes(x = wt, y = cyl, size = mpg))+
  theme_void()+
  theme(legend.position = "bottom",
        legend.box = 'horizontal', 
        plot.title = element_text(hjust = 0.5,
                                  face = "bold"),
        plot.subtitle = element_text(hjust = 0.5)
  )+ 
  guides(colour = guide_legend(nrow =   1, override.aes = list(size=5), byrow = T, title.position = "top"), 
         fill = guide_legend(nrow = 1, byrow = T, title.position = "top"),
         size =guide_legend(nrow = 2, byrow = T, title.position = "top"))

I would like to put the disp legend underneath the wt legend position. With other words: given three legends, display two in one column and two rows. and the third one in one column across two columns. Thanks

r ggplot2