Skip to content

Bug: Changing the legend.text margin t or b changes legend.key.height #5682

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

Closed
davidhodge931 opened this issue Feb 7, 2024 · 2 comments
Closed

Comments

@davidhodge931
Copy link

davidhodge931 commented Feb 7, 2024

This occurs with 3.4.4 as well as the DEV version I'm using

library(tidyverse)
library(palmerpenguins)

p <- penguins |> 
  ggplot() +
  geom_histogram(
    aes(x = flipper_length_mm, fill = sex)
  )

p
#> `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(
    legend.text = ggplot2::element_text(margin = ggplot2::margin(t = 20, b = 20)),
  )
#> `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 2024-02-07 with reprex v2.1.0

@davidhodge931 davidhodge931 changed the title Bug: Changing the legend.text margin changes the legend key size when legend is positioned at bottom Bug: Changing the legend.text margin height changes legend key size when legend at bottom Feb 7, 2024
@davidhodge931 davidhodge931 changed the title Bug: Changing the legend.text margin height changes legend key size when legend at bottom Bug: Changing the legend.text margin t or b changes legend key size Feb 7, 2024
@davidhodge931 davidhodge931 changed the title Bug: Changing the legend.text margin t or b changes legend key size Bug: Changing the legend.text margin t or b changes legend.key.height` Feb 7, 2024
@davidhodge931 davidhodge931 changed the title Bug: Changing the legend.text margin t or b changes legend.key.height` Bug: Changing the legend.text margin t or b changes legend.key.height Feb 7, 2024
@davidhodge931 davidhodge931 changed the title Bug: Changing the legend.text margin t or b changes legend.key.height Bug: Changing the legend.text margin t or b changes legend.key.height Feb 7, 2024
@teunbrand
Copy link
Collaborator

Hi David, this seems to be a duplicate of #3669, so I'm closing this issue in favour of that one to keep discussion in one place.

@davidhodge931
Copy link
Author

Oh whoops, thanks

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

No branches or pull requests

2 participants