home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 557931967

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
557931967 MDU6SXNzdWU1NTc5MzE5Njc= 3734 Wrong facet plots when all 2D arrays have one value only 22245117 closed 0     1 2020-01-31T06:00:15Z 2020-04-03T19:48:54Z 2020-04-03T19:48:54Z CONTRIBUTOR      

MCVE Code Sample

python import xarray as xr import numpy as np

```python

Create DataArray

da = xr.DataArray(np.zeros((10, 10, 4))) ```

```python

Default plot

Wrong: all of them should be 0.

da.plot(col='dim_2') ```

<xarray.plot.facetgrid.FacetGrid at 0x7f511815f3d0>

Expected Output

```python

Providing colorbar limits

Correct.

da.plot(col='dim_2', vmin=-.1, vmax=.1) ```

<xarray.plot.facetgrid.FacetGrid at 0x7f50ef14bf70>

Problem Description

If I simply use plot triggering FacetGrid to show 2D arrays which all have the same value (zero in the example above), all plots with exception of the last one are wrong. However, if I specify vmin and vmax using the same limits of the default plot, all plots are correct.

Output of xr.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.8.1 | packaged by conda-forge | (default, Jan 29 2020, 14:55:04) [GCC 7.3.0] python-bits: 64 OS: Linux OS-release: 4.4.0-133-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8 libhdf5: 1.10.5 libnetcdf: 4.7.3 xarray: 0.14.1 pandas: 1.0.0 numpy: 1.17.5 scipy: None netCDF4: 1.5.3 pydap: None h5netcdf: None h5py: None Nio: None zarr: None cftime: 1.0.4.2 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.3.1 dask: 2.10.1 distributed: 2.10.0 matplotlib: 3.1.2 cartopy: None seaborn: None numbagg: None setuptools: 45.1.0.post20200119 pip: 20.0.2 conda: None pytest: None IPython: 7.11.1 sphinx: None
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3734/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

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