Skip to content

Plot2D no longer sorts coordinates before plotting #2422

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

Closed
fmaussion opened this issue Sep 19, 2018 · 6 comments
Closed

Plot2D no longer sorts coordinates before plotting #2422

fmaussion opened this issue Sep 19, 2018 · 6 comments

Comments

@fmaussion
Copy link
Member

fmaussion commented Sep 19, 2018

I have a dataset with decreasing latitude coordinates.

With xarray v0.10.8, this is what happens when plotting:

i1

But on latest master the image is now upside down:

i2

Sorry if I missed a change along the way, I was off for a long time.

@shoyer
Copy link
Member

shoyer commented Sep 19, 2018

cc @dcherian

@shoyer
Copy link
Member

shoyer commented Sep 19, 2018

The most likely source here is #2294

@shoyer shoyer mentioned this issue Sep 19, 2018
@fmaussion
Copy link
Member Author

Looks like a difficult thing to test, also...

@dcherian
Copy link
Contributor

Yes #2294 changed the default xincrease, yincrease to be None rather than True. Previously, if xincrease was True we were setting axis limits and this prevented the axis from auto-updating its limits. Now that we are using the invert_axis() method, this might not be an issue. (Actually, now that I look at the code for invert_axis(), all I needed to do earlier was set the kwarg auto=None in the call to set_xlim, so this would be an easy way to revert to the previous code.)

I switched the default to None because I thought it was better to make the least number of modifications to the axis by default.

That said, I cannot reproduce this with a dataset with decreasing latitude so I'm very confused about what's happening.

da = xr.DataArray(np.arange(24).reshape(3,8), dims=('latitude', 'longitude'),
                 coords={'latitude': [8, 0, -8],
                        'longitude': np.arange(8)})

da.plot()

PS: I'm on a ship in the middle of the Pacific with crappy internet access. @fmaussion I'd appreciate it if you could look at this so we can get the release out. I will respond but there'll be a large time lag.

@fmaussion
Copy link
Member Author

fmaussion commented Sep 20, 2018

I cannot reproduce this with a dataset with decreasing latitude

Maybe a MPL version issue? Because our docs are also afffected, see:

@fmaussion I'd appreciate it if you could look at this

I will have a look now

@shoyer
Copy link
Member

shoyer commented Sep 21, 2018

I think this is fixed by #2425?

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

No branches or pull requests

3 participants