Legends

library(gglite)
p = g2(iris, Sepal.Length ~ Sepal.Width, color = ~ Species)

1 Legend Position

p |> legend_color(position = 'right')

2 Legend at the Top

p |> legend_color(position = 'top')

3 Legend at the Bottom

p |> legend_color(position = 'bottom')

4 Legend at the Left

p |> legend_color(position = 'left')

5 Hide a Legend

p |> legend_color(FALSE)

6 Legend with Title

p |> legend_color(position = 'right', title = 'Iris Species')