tidyverse / ggplot2

An implementation of the Grammar of Graphics in R
https://ggplot2.tidyverse.org
Other
6.39k stars 2k forks source link

Margins can be units #5932

Closed teunbrand closed 2 weeks ago

teunbrand commented 1 month ago

This PR is an amendement to #5622.

Briefly, in #5622, we required that certain margin elements in the theme are of the class 'margin'. However, reverse dependency checks shows that many people use e.g. theme(plot.margin = unit(c(4, 4, 4, 4), "mm"). This isn't necessarily wrong, so this PR allows margin elements to accept units too.