How do I increase the vertical spacing between legend key elements?
How would I do these in both legends below?
How might I do this in just 1 legend below?
library(tidyverse)
#> Warning: package 'ggplot2' was built under R version 4.3.2
#> Warning: package 'purrr' was built under R version 4.3.1
#> Warning: package 'dplyr' was built under R version 4.3.1
#> Warning: package 'forcats' was built under R version 4.3.2
#> Warning: package 'lubridate' was built under R version 4.3.1
library(palmerpenguins)
penguins |>
group_by(sex) |>
summarise(flipper_length_mm = mean(flipper_length_mm, na.rm = T)) |>
ggplot(aes(x = sex, y = flipper_length_mm, fill = sex)) +
geom_col() +
geom_point(aes(shape = sex)) +
facet_wrap(~sex) +
theme(legend.text = element_text(margin = margin())) +
labs(fill = "Legend 2", shape = "Legend 1")
#> Warning: Removed 1 rows containing missing values (`geom_point()`).