Skip to content

Conversation

Yunuuuu
Copy link
Contributor

@Yunuuuu Yunuuuu commented Dec 12, 2024

fix #6234

@Yunuuuu
Copy link
Contributor Author

Yunuuuu commented Dec 12, 2024

default_margin <- ggplot(mtcars, aes(disp, mpg)) +
    geom_point()
no_margin <- ggplot(mtcars, aes(disp, mpg)) +
    geom_point() +
    theme(plot.margin = NULL)
length(ggplotGrob(default_margin)$widths)
#> [1] 13
length(ggplotGrob(no_margin)$widths)
#> [1] 13
length(ggplotGrob(default_margin)$heights)
#> [1] 16
length(ggplotGrob(no_margin)$heights)
#> [1] 16

Copy link
Collaborator

@teunbrand teunbrand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you for the contribution!

@teunbrand teunbrand merged commit ebecea5 into tidyverse:main Dec 12, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NULL plot.margin breakdown the shape of the gtable
2 participants