home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 293858326

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
293858326 MDU6SXNzdWUyOTM4NTgzMjY= 1880 Should imshow() recognise 0-255 images? 10050469 closed 0     1 2018-02-02T11:30:21Z 2018-02-12T22:12:13Z 2018-02-12T22:12:13Z MEMBER      

Code Sample, a copy-pastable example if possible

```python import os import urllib.request import xarray as xr import matplotlib.pyplot as plt

Download the file from rasterio's repository

url = 'https://github.com/mapbox/rasterio/raw/master/tests/data/RGB.byte.tif' urllib.request.urlretrieve(url, 'RGB.byte.tif')

Read the data

da = xr.open_rasterio('RGB.byte.tif')

f, (ax1, ax2) = plt.subplots(1, 2, figsize=(9, 4)) da.plot.imshow(ax=ax1) (da / 255).plot.imshow(ax=ax2) plt.tight_layout() plt.show()

Delete the file

os.remove('RGB.byte.tif') ```

Problem description

In https://github.com/pydata/xarray/pull/1796, @Zac-HD added support for RGBA images. If an alpha channel is not found, it is added (code)

The problem is that adding this alpha channel requires the images to be normalized to 0-1, while plotting an image in 0-255 range without alpha channel works fine in matplotlib. Removing https://github.com/pydata/xarray/blob/master/xarray/plot/plot.py#L708-L715 would solve the problem, but I guess it was added for a reason.

@Zac-HD , thoughts?

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

  • 1 row from issues_id in issues_labels
  • 1 row from issue in issue_comments
Powered by Datasette · Queries took 1.563ms · About: xarray-datasette