home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 423774214

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
423774214 MDU6SXNzdWU0MjM3NzQyMTQ= 2837 DataArray plotting: pyplot compat and passing the style 2418513 open 0     6 2019-03-21T14:57:12Z 2019-04-11T16:25:49Z   NONE      

These are two unrelated issues in one really that I've noticed while trying to plot things directly from DataArray objects.


The following works as expected, by converting DataArray to pandas first)

```python

arr.to_series().plot(style='.-') arr.to_series().plot.line(style='.-') ```

Passing Series to pyplot.plot() directly also works and retains index:

```python

plt.plot(arr.to_series(), '.-') ```

Trying to set style directly when plotting from DataArray doesn't work: ```python

arr.plot(style='.-') AttributeError: Unknown property style arr.plot.line(style='.-') AttributeError: Unknown property style ```

Passing DataArray to pyplot.plot() loses index:

```python

plt.plot(arr, '.-')

works but loses coords; same as plot.plot(arr.values, '.-')

```

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2837/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 issue

Links from other tables

  • 2 rows from issues_id in issues_labels
  • 6 rows from issue in issue_comments
Powered by Datasette · Queries took 0.55ms · About: xarray-datasette