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

Facetgrid #83

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cf_xarray/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
xr.core.rolling.Rolling,
xr.core.rolling.Coarsen,
xr.core.weighted.Weighted,
xr.plot.facetgrid.FacetGrid,
)

#: `axis` names understood by cf_xarray
Expand Down Expand Up @@ -447,7 +448,7 @@ def _getattr(
attr: str,
accessor: "CFAccessor",
key_mappers: Mapping[str, Mapper],
wrap_classes: bool = False,
wrap_classes: bool = True,
extra_decorator: Callable = None,
):
"""
Expand Down
4 changes: 1 addition & 3 deletions cf_xarray/tests/test_accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,10 @@ def test_dataarray_plot():
plt.close()

rv = obj.cf.plot(x="X", y="Y", col="T")
dcherian marked this conversation as resolved.
Show resolved Hide resolved
assert isinstance(rv, xr.plot.FacetGrid)
rv.map_dataarray(xr.plot.contourf, x="X", y="Y", col="T")
plt.close()

rv = obj.cf.plot.contourf(x="X", y="Y", col="T")
assert isinstance(rv, xr.plot.FacetGrid)
plt.close()

rv = obj.isel(lat=[0, 1], lon=1).cf.plot.line(x="T", hue="Y")
Expand Down Expand Up @@ -488,7 +487,6 @@ def test_dataarray_plot():
obj = obj.copy(deep=True)
obj.time.attrs.clear()
rv = obj.cf.plot(x="X", y="Y", col="time")
assert isinstance(rv, xr.plot.FacetGrid)
dcherian marked this conversation as resolved.
Show resolved Hide resolved
plt.close()


Expand Down