Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dont infer interval breaks in pcolormesh when ax is a cartopy axis #782

Merged
merged 1 commit into from
Mar 11, 2016
Merged

dont infer interval breaks in pcolormesh when ax is a cartopy axis #782

merged 1 commit into from
Mar 11, 2016

Conversation

jhamman
Copy link
Member

@jhamman jhamman commented Mar 3, 2016

This PR chooses not to infer interval breaks in pcolormesh if the axis is a Cartopy axis. Below is an example of a plot using the new behavior - compare to #781 (comment).
xarray_new

I'll come up with a few tests here.

closes #781.

@ocefpaf
Copy link
Contributor

ocefpaf commented Mar 3, 2016

Bare in mind that some netCDF4 files do have the bounds data and those should be used as "breaks" when available.

BTW I'd rather not have the _infer_interval_breaks at all, not sure if assuming linear at the mid points are generic enough.

@jhamman
Copy link
Member Author

jhamman commented Mar 3, 2016

BTW I'd rather not have the _infer_interval_breaks at all.

Me too, but I don't mind doing it when we're not projecting the data.

@ocefpaf
Copy link
Contributor

ocefpaf commented Mar 3, 2016

What if there are bounds in the file and the data is regularly spaced? I consider the current behavior a guess, and guessing should be an active user choice, not the automatic behavior.

@jhamman
Copy link
Member Author

jhamman commented Mar 4, 2016

Short of adding cartopy to our continuous integration setup, does anyone have any ideas on how to test this change more robustly than I have shown here? I want to avoid testing the behavior of the either matplotlib or Cartopy and since in this case, we're choosing not to modify their behavior, I'm not sure we need to test further.

@jhamman
Copy link
Member Author

jhamman commented Mar 10, 2016

any more comments here?

@shoyer
Copy link
Member

shoyer commented Mar 11, 2016

This PR looks good to me.

Regarding the larger issue of not inferring bounds, I guess I would be on board with that change, too. The original idea was to make pcolormesh and imshow consistent (other than the underlying plotting engine) and to always plot that last row/column of data, but maybe it's better to force users to be explicit. At the very least, it is clearly a bad idea to adjust bounds if they are not equally spaced (but I agree that guessing is bad default behavior).

@jhamman
Copy link
Member Author

jhamman commented Mar 11, 2016

So do we want to remove _infer_interval_breaks all together in this PR? I'm leaning toward merging this as is and following up with another PR to handle the unevenly spaced coordinates in the future.

@shoyer
Copy link
Member

shoyer commented Mar 11, 2016

Works for me

On Fri, Mar 11, 2016 at 10:40 AM, Joe Hamman [email protected]
wrote:

So do we want to remove _infer_interval_breaks all together in this PR?
I'm leaning toward merging this as is and following up with another PR to
handle the unevenly spaced coordinates in the future.


Reply to this email directly or view it on GitHub
#782 (comment).

jhamman pushed a commit that referenced this pull request Mar 11, 2016
dont infer interval breaks in pcolormesh when ax is a cartopy axis
@jhamman jhamman merged commit f905289 into pydata:master Mar 11, 2016
@jhamman jhamman deleted the feature/cartopy_pcolormesh branch March 11, 2016 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't infer x/y coordinates interval breaks for cartopy plot axes
3 participants