Skip to content

plot: ValueError for invalid hue argument is confusing #4913

Closed
@tmieslinger

Description

@tmieslinger
import xarray as xr
xr.DataArray([[1,2,3], [4,5,6]], dims=("a", "b")).plot(x="a", hue="c")  # note: it should be hue="b"

What happened:
raises

ValueError: y must be one of None, 'a', 'b'

What you expected to happen:

ValueError: hue must be one of None, 'a', 'b'

Environment:

Output of xr.show_versions()

INSTALLED VERSIONS

commit: None
python: 3.7.7 (default, Mar 23 2020, 22:36:06)
[GCC 7.3.0]
python-bits: 64
OS: Linux
OS-release: 3.16.0-4-amd64
machine: x86_64
processor:
byteorder: little
LC_ALL: None
LANG: en_US.utf-8
LOCALE: en_US.UTF-8
libhdf5: 1.10.5
libnetcdf: 4.6.3

xarray: 0.16.2
pandas: 1.2.1
numpy: 1.19.2
scipy: 1.5.2
netCDF4: 1.5.4
pydap: installed
h5netcdf: None
h5py: 2.10.0
Nio: None
zarr: 2.6.1
cftime: 1.3.1
nc_time_axis: None
PseudoNetCDF: None
rasterio: 1.1.0
cfgrib: None
iris: None
bottleneck: None
dask: 2021.01.1
distributed: 2021.01.1
matplotlib: 3.3.2
cartopy: 0.18.0
seaborn: 0.11.1
numbagg: None
pint: 0.16.1
setuptools: 52.0.0.post20210125
pip: 20.3.3
conda: 4.9.2
pytest: 6.2.2
IPython: 7.20.0
sphinx: 3.4.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions