pull_requests: 159419660
This data as json
id | node_id | number | state | locked | title | user | body | created_at | updated_at | closed_at | merged_at | merge_commit_sha | assignee | milestone | draft | head | base | author_association | auto_merge | repo | url | merged_by |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
159419660 | MDExOlB1bGxSZXF1ZXN0MTU5NDE5NjYw | 1796 | closed | 0 | Support RGB[A] arrays in plot.imshow() | 12229877 | - [x] Tests added (for all bug fixes or enhancements) - [x] Tests passed (for all non-documentation changes) - [x] Passes ``git diff upstream/master **/*py | flake8 --diff`` - [x] Fully documented, including `whats-new.rst` for all changes This patch brings `xarray.plot.imshow` up to parity with `matplotlib.pyplot.imshow`: - As well as 2D images (greyscale / luminance, using a colormap), it now supports a third dimension for RGB or RGBA channels. For consistency with 2D arrays, missing data is plotted as transparent pixels - Being Xarray, users need not care about the order of their dimensions - we infer the right one for color, and warn if it's ambiguous. - ~~Using `robust=True` for easy saturation is really nice. Having it adjust each channel and facet in the same way is essential for this to work, which it does.~~ - ~~Matplotlib wraps out-of-range colors, leading to crazy maps and serious interpretation problems if it's only a small region. Xarray clips (ie saturates) to the valid range instead.~~ *I'm going to implement clip-to-range and color normalization upstream in matplotlib, then open a second PR here so that Xarray can use the same interface.* And that's the commit log! It's not really a big feature, but each of the parts can be fiddly so I've broken the commits up logically 😄 Finally, a motivating example: visible-light Landsat data before, during (top-right), and after a fire at Sampson's Flat, Australia: arr = ds['red green blue'.split()].to_array(dim='band') / (2 ** 12) arr.plot.imshow(col='time', col_wrap=5, robust=True)  | 2017-12-20T13:43:16Z | 2018-01-11T03:20:02Z | 2018-01-11T03:14:36Z | 2018-01-11T03:14:36Z | 289f95a25c08796532807c669bbb5e12a79270c2 | 0 | 868f9ea6426656d7077419446b1c4f659581ce51 | b6300ea9d9e84e24fc2e03bdff06d8d0659e2344 | CONTRIBUTOR | 13221727 | https://github.com/pydata/xarray/pull/1796 |
Links from other tables
- 0 rows from pull_requests_id in labels_pull_requests