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 datasetdates = 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 datasetds = xr.Dataset({'data': (('time', 's', 'x'), data)},
{'time':dates, 'x':x, 's':s, 'z':(('s', 'x'), z)})
ds.coords['zt'] = ds.z.transpose()
This works:
This does not:
Broadcasting, e.g., does not give a similar error. Specifically, this is true:
|
{ "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 |