Erik Bodg
Erik Bodg

Reputation: 282

Add the label down from the plot

Using ggplot2 it gives the box of legends for every line in the right of the plot

Is there any command which could add this box under the plot like this one:

enter image description here

Upvotes: 0

Views: 49

Answers (1)

bird
bird

Reputation: 3294

legend.position = "bottom" is what you are looking for:

ggplot(mtcars, aes(hp, mpg, col = factor(cyl))) +
  geom_line() +
  labs(col = NULL) +
  theme(legend.position = "bottom")

enter image description here

Upvotes: 1

Related Questions