issues: 946439792
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
946439792 | MDU6SXNzdWU5NDY0Mzk3OTI= | 5614 | col_wrap arg to da.plot() can be a string? | 7461221 | open | 0 | 2 | 2021-07-16T16:31:24Z | 2021-07-16T18:12:41Z | NONE | What happened:
if you try to plot a data array with 3 dimensions but the third dim has length 1, then if dim 3 has length >1, then What you expected to happen:
I expected an error if all a bit confusing :). I thought I understood plotting but then ran into bug #620 and started fumbling around. I am trying to plot a dataarray in a function but I don't know ahead of time how many values 3rd dim has. I also wanted to avoid limiting my function to Minimal Complete Verifiable Example: ``` da_list = [] for i in np.arange(1,3): data = np.ones((64, 48), dtype = 'uint8') * (200-i15) oneframe = xr.DataArray( data=data[..., None], dims=('x', 'y','measurement'), coords={'measurement':[f't{i40}']} )
twoframes = xr.concat(da_list, 'measurement') ```
Anything else we need to know?: @nfahlgren noted a workaround using FacetGrid directly
Environment: Windows 10, python 3.7 Output of <tt>xr.show_versions()</tt>INSTALLED VERSIONS ------------------ commit: None python: 3.7.10 | packaged by conda-forge | (default, Feb 19 2021, 15:37:01) [MSC v.1916 64 bit (AMD64)] python-bits: 64 OS: Windows OS-release: 10 machine: AMD64 processor: Intel64 Family 6 Model 158 Stepping 10, GenuineIntel byteorder: little LC_ALL: None LANG: None LOCALE: None.None libhdf5: None libnetcdf: None xarray: 0.17.0 pandas: 1.2.3 numpy: 1.20.1 scipy: 1.6.0 netCDF4: None pydap: None h5netcdf: None h5py: None Nio: None zarr: 2.7.0 cftime: None nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: None dask: 2021.02.0 distributed: 2021.02.0 matplotlib: 3.3.4 cartopy: None seaborn: None numbagg: None pint: None setuptools: 49.6.0.post20210108 pip: 21.1.2 conda: 4.10.1 pytest: 6.2.2 IPython: 7.24.1 sphinx: None |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/5614/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
13221727 | issue |