Skip to content
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

Feature request: easy_panel_spacing function #66

Open
davidhodge931 opened this issue Aug 23, 2023 · 2 comments
Open

Feature request: easy_panel_spacing function #66

davidhodge931 opened this issue Aug 23, 2023 · 2 comments

Comments

@davidhodge931
Copy link

Great package!

It'd be cool to have a function that easily adjusts the panel spacing.

So code that does this in an easy way.

library(palmerpenguins)
library(tidyverse)

p <- penguins |>
  ggplot() +
  geom_histogram(aes(x = flipper_length_mm)) +
  facet_grid(sex ~ species)

p + 
  theme(panel.spacing = grid::unit(1.25, "lines"))
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#> Warning: Removed 2 rows containing non-finite outside the scale range
#> (`stat_bin()`).

p + 
  theme(panel.spacing.x = grid::unit(1.25, "lines"))
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#> Warning: Removed 2 rows containing non-finite outside the scale range
#> (`stat_bin()`).

p +
 theme(panel.spacing.y = grid::unit(1.25, "lines"))
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#> Warning: Removed 2 rows containing non-finite outside the scale range
#> (`stat_bin()`).

Created on 2023-08-24 with reprex v2.0.2

@jonocarroll
Copy link
Owner

Thanks! This looks like a good fit - no promises on timing, but it should be entirely possible.

@davidhodge931
Copy link
Author

davidhodge931 commented Aug 24, 2023

Great, thanks :)

You might be interested in my package {ggblanket} - it has similar aims to ggeasy. Making ggplot2 simpler. It's not focussed on themes though, like ggeasy is - so the 2 packages work together nicely.

https://davidhodge931.github.io/ggblanket/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants