home / github

Menu
  • Search all tables
  • GraphQL API

issues

Table actions
  • GraphQL API for issues

1 row where state = "open" and user = 6815953 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

type 1

  • issue 1

state 1

  • open · 1 ✖

repo 1

  • xarray 1
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
523027553 MDU6SXNzdWU1MjMwMjc1NTM= 3534 Label row and column titles with units kuchaale 6815953 open 0     3 2019-11-14T18:23:25Z 2019-11-17T17:46:12Z   NONE      

According to this plotting example, xlabels and ylabels are labeled with units. However, row labels and column labels omit the units.

MCVE Code Sample

python import xarray as xr ds = xr.tutorial.scatter_example_dataset() ds.plot.scatter(x='A', y='B', col='x', row='z', hue='w', hue_style='discrete')

Expected Output

Should xr.FacetGrid include the functionality for plotting row labels and column labels when provided?

Problem Description

It could be solved with the following included in plot/facetgrid.py#L486: ```python if self.data[self._row_var].attrs.get('units'): units = self.data[self._row_var].attrs['units']
template="{coord} = {value} [{units}]"

title = nicetitle(coord=self._row_var, value=row_name, \ maxchar=maxchar, template = template, units = unit and with the following included in [plot/facetgrid.py#L499](https://github.com/pydata/xarray/blob/c0ef2f616e87e9f924425bcd373ac265f14203cb/xarray/plot/facetgrid.py#L499):python if self.data[self._col_var].attrs.get('units'): units = self.data[self._col_var].attrs['units']
template="{coord} = {value} [{units}]"

title = nicetitle(coord=self._col_var, value=col_name, \ maxchar=maxchar, template = template, units = units) and with the modification of `_nicetitle`:python def _nicetitle(coord, value, maxchar, template, units = None): """ Put coord, value in template and truncate at maxchar """ prettyvalue = format_item(value, quote_strings=False) if units is not None: title = template.format(coord=coord, value=prettyvalue, units = units) else: title = template.format(coord=coord, value=prettyvalue)

if len(title) > maxchar:
    title = title[: (maxchar - 3)] + "..."

return title

```

Output of xr.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.6.8 (default, Oct 7 2019, 12:59:55) [GCC 8.3.0] python-bits: 64 OS: Linux OS-release: 4.15.0-65-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.2 libnetcdf: 4.6.3 xarray: 0.14.0 pandas: 0.24.2 numpy: 1.17.3 scipy: 1.2.1 netCDF4: 1.5.1.2 pydap: installed h5netcdf: 0.7.4 h5py: 2.9.0 Nio: None zarr: 2.3.2 cftime: 1.0.3.4 nc_time_axis: 1.2.0 PseudoNetCDF: None rasterio: 1.0.5 cfgrib: 0.9.6.2 iris: None bottleneck: 1.2.1 dask: 2.6.0 distributed: 2.6.0 matplotlib: 3.0.3 cartopy: 0.16.0 seaborn: 0.9.0 numbagg: None setuptools: 41.0.1 pip: 19.3.1 conda: None pytest: 4.4.1 IPython: 7.1.1 sphinx: 2.0.1
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3534/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 issue

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issues] (
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [number] INTEGER,
   [title] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [state] TEXT,
   [locked] INTEGER,
   [assignee] INTEGER REFERENCES [users]([id]),
   [milestone] INTEGER REFERENCES [milestones]([id]),
   [comments] INTEGER,
   [created_at] TEXT,
   [updated_at] TEXT,
   [closed_at] TEXT,
   [author_association] TEXT,
   [active_lock_reason] TEXT,
   [draft] INTEGER,
   [pull_request] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [state_reason] TEXT,
   [repo] INTEGER REFERENCES [repos]([id]),
   [type] TEXT
);
CREATE INDEX [idx_issues_repo]
    ON [issues] ([repo]);
CREATE INDEX [idx_issues_milestone]
    ON [issues] ([milestone]);
CREATE INDEX [idx_issues_assignee]
    ON [issues] ([assignee]);
CREATE INDEX [idx_issues_user]
    ON [issues] ([user]);
Powered by Datasette · Queries took 23.867ms · About: xarray-datasette