Skip to content

Conversation

@kkollsga
Copy link
Contributor

@kkollsga kkollsga commented Feb 10, 2026

Summary

  • Adds a facetgrid_figsize option to xr.set_options() with two modes:
    • "computed" (default) — current behavior, figure size derived from size and aspect
    • "rcparams" — use matplotlib.rcParams['figure.figsize'] as the total figure size
  • Explicit figsize parameter still takes precedence over both modes
  • Follows the existing pattern of plot-related global options (cmap_sequential, cmap_divergent)

Test plan

  • Validator test: invalid value raises ValueError, context manager works for both values
  • Functional test: default behavior unchanged, "rcparams" mode uses mpl.rcParams, explicit figsize overrides
  • Full test_options.py suite passes (21 tests)
  • Full TestFacetGrid class passes (22 tests)
  • pre-commit passes (all hooks)
  • mypy has only pre-existing errors (missing stubs for pytest/dask/flox)

Add a new `facetgrid_figsize` option to `xr.set_options()` that controls
how FacetGrid determines figure size when `figsize` is not explicitly
passed. When set to `"rcparams"`, FacetGrid uses
`matplotlib.rcParams['figure.figsize']` instead of computing size from
`size` and `aspect`. Default is `"computed"` (current behavior).

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add global config for FacetGrid to always follow matplotlib.rcParams['figure.figsize']

1 participant