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

scatter plot with row or col gets hue wrong #4975

Closed
dschwoerer opened this issue Mar 1, 2021 · 3 comments · Fixed by #7616
Closed

scatter plot with row or col gets hue wrong #4975

dschwoerer opened this issue Mar 1, 2021 · 3 comments · Fixed by #7616

Comments

@dschwoerer
Copy link
Contributor

dschwoerer commented Mar 1, 2021

What happened:
The colorbar/hue is only for the last subplot, the colorbar for the other figures is ignored.

What you expected to happen:
hue/colorbar is correct - the total min/max values are calculated and used instead.

Minimal Complete Verifiable Example:

import xarray as xr
import numpy as np

ds=xr.Dataset()
ds["a"]=("x","y"), np.arange(4).reshape(2,2)

ds.plot.scatter("a","a",row="x", hue="a")
import matplotlib.pyplot as plt
plt.show()

Anything else we need to know?:
replacing col for row yields same wrong result

I verified this is in master (5735e16) and 0.16.2

Environment:

Output of xr.show_versions()

INSTALLED VERSIONS

commit: None
python: 3.9.1 (default, Jan 20 2021, 00:00:00)
[GCC 10.2.1 20201125 (Red Hat 10.2.1-9)]
python-bits: 64
OS: Linux
OS-release: 4.12.14-122.57-default
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
libhdf5: 1.10.6
libnetcdf: 4.7.3

xarray: 0.16.2
pandas: 1.0.5
numpy: 1.19.4
scipy: 1.5.2
netCDF4: 1.5.3
pydap: None
h5netcdf: None
h5py: 3.1.0
Nio: None
zarr: None
cftime: 1.1.3
nc_time_axis: 1.2.0
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: 1.2.1
dask: 2021.01.1
distributed: None
matplotlib: 3.3.4
cartopy: None
seaborn: None
numbagg: None
pint: None
setuptools: 49.1.3
pip: 20.2.2
conda: None
pytest: None
IPython: 7.18.1
sphinx: 3.2.1

@keewis
Copy link
Collaborator

keewis commented Mar 1, 2021

it seems this has already been fixed as a side-effect of #4407 (not sure what change exactly, though). cc @dcherian.

Could you try with 070d815 / v0.17.0, too? 5735e16 is pretty old.

@dschwoerer
Copy link
Contributor Author

Thanks, it is indeed fixed in 070d815 👍
Should I close #4978 ?

@keewis
Copy link
Collaborator

keewis commented Mar 1, 2021

it would be good to have tests for this (maybe by checking the min / max value of the colorbar) to make sure we don't regress. Would you be up for adding those?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants