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))+

1 Like

Excellent, thank you.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.