Skip to content

Remove deprecated FacetGrid.axes property - #11766

Open
pereradrian wants to merge 2 commits into
pydata:mainfrom
pereradrian:remove-facetgrid-axes
Open

pereradrian wants to merge 2 commits into
pydata:mainfrom
pereradrian:remove-facetgrid-axes

Conversation

@pereradrian

@pereradrian pereradrian commented Oct 20, 2026 •

Copy link
Copy Markdown

Description

Part of #11721 (the "Plotting: … remove FacetGrid.axes …" item).

FacetGrid.axes has emitted a FutureWarning since v2022.11.0 (#7194), pointing users to FacetGrid.axs. This PR removes the property and its setter.

Changes:

  • Remove the axes property and setter from xarray/plot/facetgrid.py.
  • Remove test_facetgrid_axes_raises_deprecation_warning, which only tested the warning.
  • Update two documentation examples that still used the deprecated property on a FacetGrid: doc/gallery/plot_cartopy_facetgrid.py and doc/examples/visualization_gallery.ipynb (p.axes.flat → p.axs.flat). The p.axes calls in doc/user-guide/plotting.md are left unchanged, because that plot has no col/row and returns a matplotlib artist, not a FacetGrid.
  • Add a "Breaking Changes" entry to whats-new.rst.

The other plotting items in that bullet (positional args, 1D hue_style=) are not included, to keep this PR focused.

Checklist

  • User visible changes (including notable bug fixes) are documented in whats-new.rst

AI Disclosure

  • This PR contains AI-generated content.
  • I have tested any AI-generated content in my PR.
  • I take responsibility for any AI-generated content in my PR.
    Tools: Claude Code (Claude Opus 5.5). I asked it to find a beginner-friendly open task in Tracking: open deprecations #11721, implement the FacetGrid.axes removal following the pattern of Remove deprecated dt.weekofyear and dt.week accessors #11742, and run the plotting tests (pytest xarray/tests/test_plot.py: 580 passed) and ruff.

[This is Claude Code on behalf of Adrián Muñoz Perera]

Deprecated since v2022.11.0 (pydata#7194); use FacetGrid.axs instead.
Also update the documentation examples that still used it.
Part of pydata#11721.

Co-authored-by: Claude <noreply@anthropic.com>
@pereradrian

Copy link
Copy Markdown
Author

Could someone rerun the failing test-py314 (flaky) job? The xdist workers crashed unexpectedly while running the PyDAP/DataTree tests, and the failure doesn't appear related to this PR. All other CI jobs passed. Thanks!

@headtr1ck headtr1ck left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

This branch has not been deployed

No deployments
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.

2 participants