Skip to content

Deprecate user-facing size and fatten arguments for ggplot2 4.0 compatibility#430

Open
ishaan-arora-1 wants to merge 2 commits intostan-dev:masterfrom
ishaan-arora-1:fix/deprecated-ggplot2-args-408
Open

Deprecate user-facing size and fatten arguments for ggplot2 4.0 compatibility#430
ishaan-arora-1 wants to merge 2 commits intostan-dev:masterfrom
ishaan-arora-1:fix/deprecated-ggplot2-args-408

Conversation

@ishaan-arora-1
Copy link
Contributor

Fixes #408

Picks up the remaining tasks from #408 as outlined by @jgabry in #408 (comment):

  1. Deprecate user-facing size arguments that control line width — added a linewidth parameter across ~25 plotting functions (density overlays, ribbons, ECDFs, boxplots, violins, error binned, parcoord, acf, KM overlays). The old size argument still works but emits a deprecation warning via lifecycle::deprecate_warn().

  2. Deprecate fatten for geom_pointrangeppc_intervals(), ppd_intervals(), ppc_loo_intervals(), ppc_bars(), and their grouped variants now use fatten = deprecated(). Point size is controlled directly by size, matching ggplot2 4.0 semantics. The default size was changed from 1 to 2.5 to preserve the previous visual appearance (old size * fatten = 1 * 2.5).

Added lifecycle as an imported dependency and created internal helpers (resolve_linewidth(), resolve_fatten()) to keep the deprecation logic consistent. Updated all roxygen docs and examples to use the new parameter names.

…dev#408)

Complete the remaining tasks from stan-dev#408:

- Deprecate `size` in favor of `linewidth` for all plotting functions
  where `size` controlled line width (density overlays, ribbons,
  ECDFs, boxplots, violins, error binned, parcoord, acf, KM overlays)
- Deprecate `fatten` in `ppc_intervals()`, `ppd_intervals()`,
  `ppc_loo_intervals()`, `ppc_bars()`, and grouped variants using
  `lifecycle::deprecated()`. Point size is now controlled directly
  by `size`, matching ggplot2 4.0 semantics where `fatten` was removed
  from `geom_pointrange()`
- Change default `size` from 1 to 2.5 in interval/bar plots to
  preserve visual appearance (old `size * fatten = 1 * 2.5`)
- Add `lifecycle` as an imported dependency
- Update roxygen documentation and examples
- Update tests to use `linewidth` instead of deprecated `size` for
  line-width-controlling functions (ppc_dens_overlay, ppc_ecdf_overlay,
  ppc_freqpoly, ppc_boxplot, ppc_km_overlay, ppc_ribbon)
- Remove `fatten` from test calls (ppc_bars, ppc_intervals)
- Add missing `@param linewidth` documentation in MCMC-diagnostics,
  MCMC-parcoord, PPC-censoring, and PPC-errors
- Delete stale vdiffr snapshots so they regenerate on CI
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.

Deprecated ggplot2 arguments

1 participant