extrobe
2/6/2017 - 11:22 PM

Control Legend Layout & Location in ggplot2

Control Legend Layout & Location in ggplot2

# Move legend by position
z + theme(legend.position = c(0.85, 0.85))

# Change direction
z + theme(legend.direction = "horizontal")

# Change location by name
z + theme(legend.position = "bottom")

# Remove legend entirely
z + theme(legend.position = "none")