Legend positioning

theme(legend.position = "bottom", legend.direction = "horizontal", legend.byrow = TRUE)

position sends the legend to bottom and create three columns but I want the legend to be one row to save space, so a added direction which changed nothing, then I added byrow which also changed nothing. How can I have the legend in absolutely one row?

1 Like

If, say, your legend was for a variable that is mapped to the color aesthetic, you might use

guides(color = guide_legend(nrow = 1))+

Excellent, thank you.