home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 370974503

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/pull/1967#issuecomment-370974503 https://api.github.com/repos/pydata/xarray/issues/1967 370974503 MDEyOklzc3VlQ29tbWVudDM3MDk3NDUwMw== 12229877 2018-03-07T00:06:15Z 2018-03-07T03:08:31Z CONTRIBUTOR

Ah, I see what you mean but don't think we need any change or additional test.

There's a catch though - xarray.plot() is special, because it (and only it) squeezes the dimensions of the array before plotting it. Therefore, the following calls all produce the same plot:

xr.DataArray(np.arange(9).reshape((3,3))).plot()
xr.DataArray(np.arange(9).reshape((1,3,3))).plot()
xr.DataArray(np.arange(9).reshape((1,1,3,1,1,1,1,3,1,1))).plot()

My view is that the test you linked to is sufficient for the test you're asking for - imshow is a special case because it can accept 3D input for RGB plots.

TLDR - working as intended IMO, it's just that nobody reads the docs. Changing the API would avoid this but at cost of convenience which is the whole point of DataArray.plot().

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  302695966
Powered by Datasette · Queries took 0.722ms · About: xarray-datasette