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

Deprecate fatten #6238

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

teunbrand
Copy link
Collaborator

This PR aims to fix #4881.

Briefly it deprecates fatten in geom_pointrange() (per linked issue), but also geom_boxplot() and geom_crossbar().
The parameter still works as it used to, but this at least starts the deprecation process.
There is a slight hiccup in geom_boxplot() as it isn't a named argument, but we check for if the argument has been picked up in the parameters.

devtools::load_all("~/packages/ggplot2/")
#> ℹ Loading ggplot2

df <- data.frame(
  trt = factor(c(1, 1, 2, 2)),
  resp = c(1, 5, 3, 4),
  group = factor(c(1, 2, 1, 2)),
  upper = c(1.1, 5.3, 3.3, 4.2),
  lower = c(0.8, 4.6, 2.4, 3.6)
)

p <- ggplot(df, aes(x = trt, y = resp, col = group, ymin = lower, ymax = upper))

ggplotGrob(
  p + geom_pointrange() + 
    geom_crossbar() + 
    geom_boxplot()
) |> invisible()

ggplotGrob(
  p + geom_pointrange(fatten = 1) + 
    geom_crossbar(fatten = 1) + 
    geom_boxplot(fatten = 1)
) |> invisible()
#> Warning: The `fatten` argument of `geom_pointrange()` is deprecated as of ggplot2 3.6.0.
#> ℹ Please use the `size` aesthetic instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
#> Warning: The `fatten` argument of `geom_crossbar()` is deprecated as of ggplot2 3.6.0.
#> ℹ Please use the `middle.linewidth` argument instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
#> Warning: The `fatten` argument of `geom_boxplot()` is deprecated as of ggplot2 3.6.0.
#> ℹ Please use the `median.linewidth` argument instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.

Created on 2024-12-12 with reprex v2.1.1

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.

Can we deprecate fatten arg of geom_pointrange()?
1 participant