home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 469344355

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
469344355 MDU6SXNzdWU0NjkzNDQzNTU= 3138 Plotting with 2d coordinates, error in transposed coordinate 2599958 closed 0     3 2019-07-17T17:16:51Z 2019-12-04T16:45:13Z 2019-12-04T16:45:13Z NONE      

This is similar to issue #1503, but specifically deals with requiring the correct order of dimensions for plotting 2d coordinates. An example of the issue is:

```

create an example dataset

dates = pd.date_range('2000-01-01', '2001-12-31', name='time') times = dates - dates[0]

x = np.linspace(0, 10, 101)

h = np.linspace(3, 7, 101) s = np.linspace(0, 1, 51) z = s[:, np.newaxis] * h[np.newaxis, :]

data = (np.sin(x) * np.cos(z)) * np.cos(np.asarray(times.days[:, np.newaxis, np.newaxis]))

create an xarray dataset

ds = xr.Dataset({'data': (('time', 's', 'x'), data)}, {'time':dates, 'x':x, 's':s, 'z':(('s', 'x'), z)}) ds.coords['zt'] = ds.z.transpose() `` plotting withzandzt` should give the same results, since the dimensions are clearly labeled and other than the order of the dimensions, they are exactly the same.

This works: ds.data[0].plot(x='x', y='z')

This does not: ds.data[0].plot(x='x', y='zt')

Broadcasting, e.g., does not give a similar error. Specifically, this is true: np.allclose((ds.data * ds.zt).values, (ds.data * ds.z).values)

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3138/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

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