Move Position of ggplot2 Legend in R (4 Examples) | Change Plot Layout Using theme & legend.position

preview_player
Показать описание
R code of this video:

y = 1:3,
group = LETTERS[1:3])

library("ggplot2")

ggp <- ggplot(data, aes(x, y, col = group)) + # Default ggplot2 plot
geom_point()
ggp # Draw plot

ggp + # Move legend to the bottom

ggp + # Move legend to the top

ggp + # Move legend to the left

ggp + # Legend inside the plot

Follow me on Social Media:
Рекомендации по теме
Комментарии
Автор

Thanks Joachim! Your tutorials are short, to the point and very effective.

fernandomayorga
Автор

you are great..you are doing social work and best teaching.. god bless you bro. most of the videos are useful.

Planetearth
welcome to shbcf.ru