home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 282000017

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
282000017 MDU6SXNzdWUyODIwMDAwMTc= 1780 DataArray.plot raises exception if contents are all NaN 12229877 closed 0     7 2017-12-14T06:58:38Z 2017-12-15T17:31:39Z 2017-12-15T17:31:39Z CONTRIBUTOR      

Code Sample, a copy-pastable example if possible

python xr.DataArray(np.full((2, 2), 0)).plot.imshow() # works xr.DataArray(np.full((2, 2), np.nan)).plot.imshow() # doesn't

Problem description

If you try to plot a DataArray which is entirely filled with NaN, you get an exception. This is really, really annoying for people doing satellite image analysis, especially with timeseries where just one step might be very cloudy.

Expected Output

Plot of the array extent, entirely in the missing-value colour as for partially-missing data.

Output of xr.show_versions()

Confirmed on Windows/Linux/OSX, Xarray 0.9.6 and 0.10.0; sample show_versions below. It's a pretty obvious error though in failing to handle the no-non-missing-data case when determining data range.

INSTALLED VERSIONS ------------------ commit: None python: 3.6.3.final.0 python-bits: 64 OS: Linux OS-release: 2.6.32-696.10.3.el6.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_AU.UTF-8 LOCALE: en_AU.UTF-8 xarray: 0.10.0 pandas: 0.20.3 numpy: 1.13.3 scipy: 0.19.1 netCDF4: 1.3.1 h5netcdf: None Nio: None bottleneck: 1.2.1 cyordereddict: None dask: 0.15.3 matplotlib: 2.1.0 cartopy: None seaborn: 0.8.0 setuptools: 36.5.0.post20170921 pip: 9.0.1 conda: 4.3.30 pytest: 3.2.1 IPython: 6.1.0 sphinx: 1.6.3
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1780/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 1 row from issues_id in issues_labels
  • 7 rows from issue in issue_comments
Powered by Datasette · Queries took 77.184ms · About: xarray-datasette