home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

1 row where type = "issue" and user = 32569566 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

type 1

  • issue · 1 ✖

state 1

  • closed 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
1338173609 I_kwDOAMm_X85Pwuip 6914 plt.imshow() vs xarray_dataset.plot.imshow() not rendering correctly | Potential Bug melioristic 32569566 closed 0     4 2022-08-14T08:40:56Z 2023-03-22T20:46:23Z 2023-03-22T20:46:23Z NONE      

What is your issue?

I have 2d data which I want to visualise. The visuals look completely different if I use plt.imshow() vs xarray_dataset.plot.imshow() There are mainly two issues - First, the array is flipped. (I think this is manageable but inconsistent) - Secondly, the plots don't look correct. This can be best illustrated by the figures themselves.

For example this is the xarray code I am using.

day_data.plot.imshow(cmap= "Blues", vmin =1, vmax = 100) plt.show()

And this is the image that I get.

Secondly, when I use the matplotlib to plot the values. plt.imshow(day_data.values, vmin = 1, vmax = 100, cmap = 'Blues') plt.show() I get this plot.

Since it is a discharge data I would expect to see the second plot. Can someone tell me what is the issue here?

P.S.

This is how day_data looks like.

xarray.DataArray'dis06'y: 950x: 1000 array([[nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], ..., [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan], [nan, nan, nan, ..., nan, nan, nan]], dtype=float32) Coordinates: time () datetime64[ns] 2019-10-24T06:00:00 step () timedelta64[ns] 06:00:00 surface () float64 0.0 latitude (y, x) float64 ... longitude (y, x) float64 ... valid_time () datetime64[ns] 2019-10-24T12:00:00 Attributes: GRIB_paramId : 240023 GRIB_dataType : sfo GRIB_numberOfPoints : 950000 GRIB_typeOfLevel : surface GRIB_stepUnits : 1 GRIB_stepType : avg GRIB_gridType : lambert_azimuthal_equal_area GRIB_NV : 0 GRIB_cfName : unknown GRIB_cfVarName : dis06 GRIB_gridDefinitionDescription : Lambert azimuthal equal area projection GRIB_missingValue : 9999 GRIB_name : Mean discharge in the last 6 hours GRIB_shortName : dis06 GRIB_units : m**3 s**-1 long_name : Mean discharge in the last 6 hours units : m**3 s**-1 standard_name : unknown

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6914/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 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 20.205ms · About: xarray-datasette