Replies: 1 comment 1 reply
-
|
IMO we can't do anything here. The grid being plotted is defined by the coordinate arrays, and non-uniformly spaced coordinate arrays are quite common. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is an extreme edge case, but I found the following behaviour in
.plot.imshow()counterintuitive.As a problem setting - I was testing a pipeline that combines different well-tiled arrays using
xr.combine_by_coords. They form a neat, contiguous grid, but I wanted to see what happened if some were missing. The two original arrays in this example (purple and yellow) are non-contiguous in the (x,y) plane, but after being combined, they are plotted contiguously, and the x and y tick labels suggest that there is data in the 10-20 range for x and y.Code for generating the figure
xr.combine_by_coordshere is behaving like I would expect, and plotting too, since it wraps aroundmatplotlib.pyplotand the array is strictly contiguous (as plotted). However, the lables along the axis are misleading, since there is no data in the 10-20 range for both x and y.This is an edge case, and arguably the problem is working with the discontinuity in the x and y coords, but to me this raises the question: should the plotter warn us that plotting discontinuous data can lead to unintuitive results?
If this is the case I'd be happy to create an issue and work in a PR to address it.
Beta Was this translation helpful? Give feedback.
All reactions