home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 987551524

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
987551524 MDU6SXNzdWU5ODc1NTE1MjQ= 5762 Plotting of labelled data fails 5637662 closed 0     3 2021-09-03T08:45:34Z 2023-03-10T20:01:19Z 2023-03-10T20:01:18Z CONTRIBUTOR      

What happened: Xarray has some assumption what is or is not plottable. Xarray should not do that, and just ask the plotting library, if it actually can.

What you expected to happen: No additional checking, just plot it.

If something cannot be plotted, matplotlib (or whatever backend is used) will anyway check, and know better.

Minimal Complete Verifiable Example:

```python import xarray as xr import matplotlib.pyplot as plt

da = xr.DataArray(data=[1, 2], coords={"x": ["abc", "cde"]}, dims="x") print(da) try: da.plot() except TypeError: plt.plot(da.x, da) print("But it is possible") plt.show() ```

Anything else we need to know?: I can submit a PR to remove _ensure_plottable

Environment:

Output of <tt>xr.show_versions()</tt> INSTALLED VERSIONS ------------------ commit: fcebe5e5f3bcd2d93df614966431c845384a3b2f python: 3.9.7 (default, Aug 30 2021, 00:00:00) [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)] python-bits: 64 OS: Linux OS-release: 5.13.12-200.fc34.x86_64 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.18.2 pandas: 1.2.5 numpy: 1.20.1 scipy: 1.6.2 netCDF4: 1.5.5.1 pydap: None h5netcdf: None h5py: 3.1.0 Nio: None zarr: None cftime: 1.4.1 nc_time_axis: None PseudoNetCDF: None rasterio: None cfgrib: None iris: None bottleneck: 1.2.1 dask: 2021.08.1 distributed: None matplotlib: 3.4.3 cartopy: None seaborn: None numbagg: None pint: 0.16.1 setuptools: 54.2.0 pip: 21.0.1 conda: None pytest: 6.2.2 IPython: 7.20.0 sphinx: 3.4.3
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5762/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  not_planned 13221727 issue

Links from other tables

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