Skip to content

add padding cell in final gtable for NULL plot.margin #6235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 12, 2024

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