Skip to content

ensure all plots share the same hue #4978

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

Closed
wants to merge 3 commits into from
Closed
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: 3 additions & 0 deletions doc/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ Bug fixes
- Expand user directory paths (e.g. ``~/``) in :py:func:`open_mfdataset` and
:py:meth:`Dataset.to_zarr` (:issue:`4783`, :pull:`4795`).
By `Julien Seguinot <https://github.com/juseg>`_.
- Add :py:meth:`Dataset.drop_isel` and :py:meth:`DataArray.drop_isel` (:issue:`4658`, :pull:`4819`). By `Daniel Mesejo <https://github.com/mesejo>`_.
- Facet-scatter plots of datasets use a common colorbar. (:issue:`4975`, :pull:`4978`)
By `David Schwörer <https://github.com/dschwoerer>`_.
- Raise DeprecationWarning when trying to typecast a tuple containing a :py:class:`DataArray`.
User now prompted to first call `.data` on it (:issue:`4483`).
By `Chun Ho Chow <https://github.com/chunhochow>`_.
Expand Down
5 changes: 5 additions & 0 deletions xarray/plot/dataset_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,11 @@ def newplotfunc(
# remove kwargs to avoid passing the information twice
for arg in ["meta_data", "kwargs", "ds"]:
del allargs[arg]
if hue is not None:
if vmin is None:
allargs["vmin"] = ds[hue].min()
if vmax is None:
allargs["vmax"] = ds[hue].max()

return _easy_facetgrid(kind="dataset", **allargs, **kwargs)

Expand Down